Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1.4
-
Fix Version/s: JRuby 1.2
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:Solaris 10, JRuby 1.1.4
Description
This simple script on Solaris 10 demonstrates the problem:
Dir["/proc/0/path/*"] # jtest.rb
The /proc/0 directory, and all files in it, are owned by root. If I try to read that file as a non-root user I get this:
>jruby jtest.rb
org.jruby.util.Dir:535:in `files': java.lang.NullPointerException
from org.jruby.util.Dir:654:in `glob_helper'
from org.jruby.util.Dir:451:in `push_globs'
from org.jruby.util.Dir:425:in `push_braces'
from org.jruby.util.Dir:304:in `push_glob'
from org.jruby.RubyDir:165:in `aref'
from org.jruby.RubyDir$s_method_0_0$RUBYINVOKER$aref:-1:in `call'
from org.jruby.internal.runtime.methods.JavaMethod$JavaMethodNoBlock:62:in `call'
from org.jruby.internal.runtime.methods.DynamicMethod:242:in `call'
from org.jruby.internal.runtime.methods.DynamicMethod:151:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:156:in `cacheAndCall'
from org.jruby.runtime.CallSite$InlineCachingCallSite:394:in `call'
from jtest:1:in `__file__'
from jtest:-1:in `__file__'
from jtest:-1:in `load'
from org.jruby.Ruby:544:in `runScript'
from org.jruby.Ruby:457:in `runNormally'
from org.jruby.Ruby:330:in `runFromMain'
from org.jruby.Main:214:in `run'
from org.jruby.Main:100:in `run'
from org.jruby.Main:84:in `main'
BTW, MRI's behavior is to just return an empty array.