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

AbstractItem.doReload picks wrong name for some branch projects

      AbstractItem.load and Items.load presume that File.getName on an item.getRootDir corresponds to the Item.getName. But as of JENKINS-41124 this is not true of some computed folder children, such as branch projects with various metacharacters including _. While AbstractFolder.loadChildren takes this fact into account by looking for name-utf8.txt, direct calls to onLoad from core could bypass that logic, causing the Item.name to improperly be the File.name which may be something mangled, causing bizarre behavior.

      Noticed because of a bug found in CloudBees CI multibranch tests. Normally not an issue since user-level REST/CLI reload would be blocked on read-only branch projects, but SYSTEM can still reload from plugins and trigger the problem.

          [JENKINS-72613] AbstractItem.doReload picks wrong name for some branch projects

          Jesse Glick created issue -
          Jesse Glick made changes -
          Link New: This issue is caused by JENKINS-41124 [ JENKINS-41124 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Description New: {{AbstractItem.load}} and {{Items.load}} presume that {{File.getName}} on an {{item.getRootDir}} corresponds to the {{Item.getName}}. But as of JENKINS-41124 this is not true of some computed folder children, such as branch projects with various metacharacters including {{_}}. While {{AbstractFolder.loadChildren}} takes this fact into account by looking for {{name-utf8.txt}}, direct calls to {{onLoad}} from core could bypass that logic, causing the {{Item.name}} to improperly be the {{File.name}} which may be something mangled, causing bizarre behavior.

          Noticed because of a bug found in CloudBees CI multibranch tests.
          Jesse Glick made changes -
          Description Original: {{AbstractItem.load}} and {{Items.load}} presume that {{File.getName}} on an {{item.getRootDir}} corresponds to the {{Item.getName}}. But as of JENKINS-41124 this is not true of some computed folder children, such as branch projects with various metacharacters including {{_}}. While {{AbstractFolder.loadChildren}} takes this fact into account by looking for {{name-utf8.txt}}, direct calls to {{onLoad}} from core could bypass that logic, causing the {{Item.name}} to improperly be the {{File.name}} which may be something mangled, causing bizarre behavior.

          Noticed because of a bug found in CloudBees CI multibranch tests.
          New: {{AbstractItem.load}} and {{Items.load}} presume that {{File.getName}} on an {{item.getRootDir}} corresponds to the {{Item.getName}}. But as of JENKINS-41124 this is not true of some computed folder children, such as branch projects with various metacharacters including {{_}}. While {{AbstractFolder.loadChildren}} takes this fact into account by looking for {{name-utf8.txt}}, direct calls to {{onLoad}} from core could bypass that logic, causing the {{Item.name}} to improperly be the {{File.name}} which may be something mangled, causing bizarre behavior.

          Noticed because of a bug found in CloudBees CI multibranch tests. Normally not an issue since user-level REST/CLI reload would be blocked on read-only branch projects, but {{SYSTEM}} can still reload from plugins and trigger the problem.
          Jesse Glick made changes -
          Remote Link New: This issue links to "jenkins #8902 (Web Link)" [ 29456 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "cloudbees-folder-plugin #367 (Web Link)" [ 29457 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "workflow-multibranch-plugin #292 (Web Link)" [ 29458 ]
          Jesse Glick made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Alexander Brandes made changes -
          Released As New: 2.444
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Closed [ 6 ]
          Jesse Glick made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Closed [ 6 ] New: In Review [ 10005 ]

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: