Skip to content
Permalink
Browse files

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

(cherry picked from commit b06e2aa)
  • Loading branch information
daniel-beck authored and olivergondza committed Aug 5, 2014
1 parent dbab8f9 commit 2f718f4d1fbdc4147f590731de2d52f184241d88
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 2f718f4

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