Skip to content

Commit

Permalink
[JENKINS-26476] Noting merge of #1536.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Jan 20, 2015
2 parents 6852d75 + 36bce39 commit a22843b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion changelog.html
Expand Up @@ -55,7 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=>
<li class=bug>
Remote <code>FilePath.chmod</code> fails with <code>ClassNotFoundException: javax.servlet.ServletException</code>.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-26476">issue 26476</a>)
</ul>
</div><!--=TRUNK-END=-->

Expand Down
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/FilePath.java
Expand Up @@ -1581,6 +1581,7 @@ public void chmod(final int mask) throws IOException, InterruptedException {
act(new SecureFileCallable<Void>() {
private static final long serialVersionUID = 1L;
public Void invoke(File f, VirtualChannel channel) throws IOException {
// TODO first check for Java 7+ and use PosixFileAttributeView
_chmod(writing(f), mask);

return null;
Expand All @@ -1592,7 +1593,9 @@ public Void invoke(File f, VirtualChannel channel) throws IOException {
* Run chmod via jnr-posix
*/
private static void _chmod(File f, int mask) throws IOException {
if (Functions.isWindows()) return; // noop
// TODO WindowsPosix actually does something here (WindowsLibC._wchmod); should we let it?
// Anyway the existing calls already skip this method if on Windows.
if (File.pathSeparatorChar==';') return; // noop

PosixAPI.jnr().chmod(f.getAbsolutePath(),mask);
}
Expand Down

0 comments on commit a22843b

Please sign in to comment.