• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • CentOS 5.5
      JRE 1.6.0
      Jenkins 1.413

      If a project is configured with a "blank" custom workspace in it's Advanced Project Options, then when the workspace is cleaned, $JENKINS_HOME is deleted.

      More specifically, if the "Use custom workspace" option is ticked, but the "Directory" field is not filled in, then the workspace directory is effectively $JENKINS_HOME.

      Presumably this is because (as the docs mention) the custom workspace is relative to $JENKINS_HOME.

      This is a serious issue, because a workspace clean removes all Jenkins workspaces, all Jenkins job configuration etc. without warning.

      Please protect silly people like me from myself!!!!!

          [JENKINS-9806] JENKINS_HOME deleted by Jenkins

          Harry G. added a comment -

          Horrible! It's not to protect silly people like you from yourself.
          I'ts that any user who is allowed to configure at leat one job can accidentially delete the entire JENKINS_HOME!!!

          Harry G. added a comment - Horrible! It's not to protect silly people like you from yourself. I'ts that any user who is allowed to configure at leat one job can accidentially delete the entire JENKINS_HOME!!!

          vjuranek added a comment -

          vjuranek added a comment - Possible fix: https://github.com/jenkinsci/jenkins/pull/147

          typerlc added a comment - - edited

          Looks like an improvement to me.

          I guess Jenkins doesn't really guarantee safety of the filesystem in general (no sandboxing of the build). But given the potential for damage, is it wise to allow JENKINS_HOME to be selected in any circumstance?

          Perhaps a nicer fix would check that the custom workspace is in a sub-directory of JENKINS_HOME (maybe a custom_builds/ directory). Or if you want to permit other directories, at least not in an ancestor directory of JENKINS_HOME.

          typerlc added a comment - - edited Looks like an improvement to me. I guess Jenkins doesn't really guarantee safety of the filesystem in general (no sandboxing of the build). But given the potential for damage, is it wise to allow JENKINS_HOME to be selected in any circumstance? Perhaps a nicer fix would check that the custom workspace is in a sub-directory of JENKINS_HOME (maybe a custom_builds/ directory). Or if you want to permit other directories, at least not in an ancestor directory of JENKINS_HOME.

          vjuranek added a comment -

          As commented under [1], permission check is quite complex issue. Therefore closing this issue (as it should be solved by merged pull request [1]) and created feature request for implementation of this check [2]

          [1] https://github.com/jenkinsci/jenkins/pull/147
          [2] https://issues.jenkins-ci.org/browse/JENKINS-9899

          vjuranek added a comment - As commented under [1] , permission check is quite complex issue. Therefore closing this issue (as it should be solved by merged pull request [1] ) and created feature request for implementation of this check [2] [1] https://github.com/jenkinsci/jenkins/pull/147 [2] https://issues.jenkins-ci.org/browse/JENKINS-9899

          dogfood added a comment -

          Integrated in jenkins_main_trunk #848
          Possible fix for JENKINS-9806, fix empty customWorkspace -if empry, replace it by null (i.e. no custom workspace)
          [FIXED JENKINS-9806] the actual fix are in the two previous commits.

          Kohsuke Kawaguchi : 8b4f30a162e8169a0537ae25d406aa86c7609dd0
          Files :

          • core/src/main/java/hudson/model/AbstractProject.java

          Kohsuke Kawaguchi : a1ed1b2278592d61619986a615d56dac3bdc5b76
          Files :

          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #848 Possible fix for JENKINS-9806 , fix empty customWorkspace -if empry, replace it by null (i.e. no custom workspace) [FIXED JENKINS-9806] the actual fix are in the two previous commits. Kohsuke Kawaguchi : 8b4f30a162e8169a0537ae25d406aa86c7609dd0 Files : core/src/main/java/hudson/model/AbstractProject.java Kohsuke Kawaguchi : a1ed1b2278592d61619986a615d56dac3bdc5b76 Files : changelog.html

          Code changed in jenkins
          User: Vojtech Juranek
          Path:
          core/src/main/java/hudson/model/AbstractProject.java
          http://jenkins-ci.org/commit/jenkins/8b4f30a162e8169a0537ae25d406aa86c7609dd0
          Log:
          Possible fix for JENKINS-9806, fix empty customWorkspace -if empry, replace it by null (i.e. no custom workspace)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vojtech Juranek Path: core/src/main/java/hudson/model/AbstractProject.java http://jenkins-ci.org/commit/jenkins/8b4f30a162e8169a0537ae25d406aa86c7609dd0 Log: Possible fix for JENKINS-9806 , fix empty customWorkspace -if empry, replace it by null (i.e. no custom workspace)

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/a1ed1b2278592d61619986a615d56dac3bdc5b76
          Log:
          [FIXED JENKINS-9806] the actual fix are in the two previous commits.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/a1ed1b2278592d61619986a615d56dac3bdc5b76 Log: [FIXED JENKINS-9806] the actual fix are in the two previous commits.

          Code changed in jenkins
          User: Vojtech Juranek
          Path:
          core/src/main/java/hudson/model/AbstractProject.java
          http://jenkins-ci.org/commit/jenkins/8b4f30a162e8169a0537ae25d406aa86c7609dd0
          Log:
          Possible fix for JENKINS-9806, fix empty customWorkspace -if empry, replace it by null (i.e. no custom workspace)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vojtech Juranek Path: core/src/main/java/hudson/model/AbstractProject.java http://jenkins-ci.org/commit/jenkins/8b4f30a162e8169a0537ae25d406aa86c7609dd0 Log: Possible fix for JENKINS-9806 , fix empty customWorkspace -if empry, replace it by null (i.e. no custom workspace)

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/a1ed1b2278592d61619986a615d56dac3bdc5b76
          Log:
          [FIXED JENKINS-9806] the actual fix are in the two previous commits.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/a1ed1b2278592d61619986a615d56dac3bdc5b76 Log: [FIXED JENKINS-9806] the actual fix are in the two previous commits.

            Unassigned Unassigned
            typerlc typerlc
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: