Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-23683] Check whether war's directory is writable
  • Loading branch information
daniel-beck committed Jul 3, 2014
1 parent 264bd1a commit b06e2aa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/src/main/java/hudson/lifecycle/Lifecycle.java
Expand Up @@ -158,7 +158,14 @@ public void rewriteHudsonWar(File by) throws IOException {
public boolean canRewriteHudsonWar() {
// if we don't know where jenkins.war is, it's impossible to replace.
File f = getHudsonWar();
return f!=null && f.canWrite();
if (f == null || !f.canWrite()) {
return false;
}
File parent = f.getParentFile();
if (parent == null || !parent.canWrite()) {
return false;
}
return true;
}

/**
Expand Down

0 comments on commit b06e2aa

Please sign in to comment.