Dir[] results in NPE depending on permissions
---------------------------------------------

                 Key: JRUBY-2997
                 URL: http://jira.codehaus.org/browse/JRUBY-2997
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1.4
         Environment: Solaris 10, JRuby 1.1.4
            Reporter: Daniel Berger


This simple script on Solaris 10 demonstrates the problem:
{noformat}
Dir["/proc/0/path/*"] # jtest.rb
{noformat}
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:
{noformat}
>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'
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to