You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling FileUtils.chmod on a symlink tries to call File.lchmod if available. It checks this by calling File.lchmod with an empty file list. This succeeds, because POSIX.lchmod is not actually called in this case:
if (0 != runtime.getPosix().lchmod(file.toString(), (int) mode.getLongValue())) {
throwruntime.newErrnoFromLastPOSIXErrno();
} else {
count++;
}
}
returnruntime.newFixnum(count);
}
This leads to the following error, because lchmod does not exist under linux:
NotImplementedError: No message available
lchmod at org/jruby/RubyFile.java:1019
chmod at /data/software/jruby/9.2.5.0/lib/ruby/stdlib/fileutils.rb:1320
chmod at /data/software/jruby/9.2.5.0/lib/ruby/stdlib/fileutils.rb:1000
each at org/jruby/RubyArray.java:1792
chmod at /data/software/jruby/9.2.5.0/lib/ruby/stdlib/fileutils.rb:999
<main> at ./test.rb:15
This is the test program I used, which includes a workaround that makes sure File.lchmod is not considered available:
#!/usr/bin/env jrubyrequire'fileutils'# uncomment to fix NotImplementedError# class FileUtils::Entry_# def have_lchmod?# false# end# endFileUtils.rm_f"link"FileUtils.ln_s"target","link"FileUtils.chmod400,"link"
I am using jruby 9.2.5.0 under RHEL 7.4.
The text was updated successfully, but these errors were encountered:
Calling
FileUtils.chmod
on a symlink tries to callFile.lchmod
if available. It checks this by callingFile.lchmod
with an empty file list. This succeeds, becausePOSIX.lchmod
is not actually called in this case:jruby/core/src/main/java/org/jruby/RubyFile.java
Lines 1010 to 1026 in d03c357
This leads to the following error, because
lchmod
does not exist under linux:This is the test program I used, which includes a workaround that makes sure
File.lchmod
is not considered available:I am using jruby 9.2.5.0 under RHEL 7.4.
The text was updated successfully, but these errors were encountered: