Skip to content
Permalink
Browse files

[FIXED JENKINS-23683] Check whether war's directory is writable

  • Loading branch information
daniel-beck committed Jul 3, 2014
1 parent 264bd1a commit b06e2aa3414d480d8b44459b0632226921be85f6
Showing with 8 additions and 1 deletion.
  1. +8 −1 core/src/main/java/hudson/lifecycle/Lifecycle.java
@@ -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;
}

/**

0 comments on commit b06e2aa

Please sign in to comment.
You can’t perform that action at this time.