Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37189

a file:// update center will always be offline

    XMLWordPrintable

Details

    Description

      The code in hudson.model.UpdateCenter$UpdateCenterConfiguration.checkUpdateCentermakes blind assumptions about the protocol and validity of an update center URL.

      Blindly appending a string to a URL does not necessarily a valid URL for connection checking make.

      For example the URL could be a file based url
      and the URL file://c:/some/path/to/updates.json will become file://c:/some/path/to/updates.json?uctest

      Later on the URL is used in hudson.model.UpdateCenter.UpdateCenterConfiguration.test connection(URL) - and if it is not a http URL it will try Util.copyStreamAndClose(connection.getInputStream(),new NullOutputStream()); which on windows will fail as it will try and open c:\some\path\to\updates.json?uctest which will fail with an exception - and then fail the update check.

              public void checkUpdateCenter(ConnectionCheckJob job, String updateCenterUrl) throws IOException {
                  testConnection(new URL(updateCenterUrl + "?uctest"));
              }
      

      Attachments

        Activity

          teilo James Nord created issue -
          stephenconnolly Stephen Connolly made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          stephenconnolly Stephen Connolly made changes -
          Assignee stephenconnolly [ stephenconnolly ]
          stephenconnolly Stephen Connolly made changes -
          Remote Link This issue links to "PR 2500 (Web Link)" [ 14711 ]
          stephenconnolly Stephen Connolly made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          stephenconnolly Stephen Connolly made changes -
          Resolution Fixed [ 1 ]
          Status In Review [ 10005 ] Resolved [ 5 ]
          stephenconnolly Stephen Connolly made changes -
          Labels lts-candidate
          olivergondza Oliver Gond┼ża made changes -
          Labels lts-candidate 2.7.3-fixed
          stephenconnolly Stephen Connolly made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          cloudbees CloudBees Inc. made changes -
          Remote Link This issue links to "CloudBees Internal OSS-1297 (Web Link)" [ 18747 ]
          cloudbees CloudBees Inc. made changes -
          Remote Link This issue links to "CloudBees Internal OSS-1284 (Web Link)" [ 18750 ]

          People

            stephenconnolly Stephen Connolly
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: