Skip to content
Permalink
Browse files

Merge pull request #1311 from daniel-beck/JENKINS-23683

[FIXED JENKINS-23683] Check whether war's directory is writable
  • Loading branch information
oleg-nenashev committed Jul 7, 2014
2 parents ca53100 + b06e2aa commit 773144f0a1f786f50086bac6e3af65380ceff9fb
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 773144f

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