-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File.realpath doesn't follow symlinks #538
Comments
As a work-around I did file = java.io.File.new(path)
real_path = file.canonical_path |
[#50752269] File.realpath does resolve symlinks in JRuby (jruby/jruby#538). To work-around the issue, wrap compatibility code in MetasploitDataModels::File.realpath.
This might have been fixed at somepoint between 1.7.9 and 1.7.18:
|
JRuby 1.7.14 fixed the bug. From: Lee Green This might have been fixed at somepoint between 1.7.9 and 1.7.18: leeg-mbp-13:~ lee$ ls -l /tmp/ leeg-mbp-13:~ lee$ rvm use 1.7.18 leeg-mbp-13:~ lee$ irb — |
Based on that snippet I am resolving against 1.7.14. Thanks for the sleuthing! |
I hoped this would just be a case of copying the logic from rubinius, https://github.com/rubinius/rubinius/blob/master/kernel/common/file19.rb#L98, however that code doesn't raise Errno::ENOENT in the case when the symlink is absent or broken rubinius/rubinius#2165. It might be better to copy the code from 1.8.7's Pathname#realpath which has the behaviour I was expecting.
The text was updated successfully, but these errors were encountered: