JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-4440

[windows] Dir.mkdir creates the named directory with wrong permissions

    Details

    • Number of attachments :
      0

      Description

      On windows, RubySpec failure:

      mspec -t j core\dir
      jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2010-01-08 f024eb2) (Java HotSpot(TM) Client VM 1.6.0_17) [x86-java]
      
      1)
      Dir.mkdir creates the named directory with the given permissions FAILED
      Expected 16877
       not to equal 16877
      
      D:/work/jruby-dev/rubyspec.git/core/dir/mkdir_spec.rb:30
      D:/work/jruby-dev/rubyspec.git/core/dir/mkdir_spec.rb:26
      D:/work/jruby-dev/rubyspec.git/core/dir/mkdir_spec.rb:4
      D:/work/jruby-dev/rubyspec.git/core/dir/mkdir_spec.rb:55:in `load'
      D:/work/jruby-dev/mspec.git/bin/mspec-run:8
      

        Activity

        Hide
        Luca Simone added a comment - - edited

        got some tests on this, it's practically impossible to fix in windows, File.setReadable, setExecutable and setWritable do nothing. The only way to fix this is wait jdk7 and NIO2?

        Show
        Luca Simone added a comment - - edited got some tests on this, it's practically impossible to fix in windows, File.setReadable, setExecutable and setWritable do nothing. The only way to fix this is wait jdk7 and NIO2?
        Hide
        Thomas E Enebo added a comment -

        Our jnr-posix library gives us the ability to call windows Kernel32, etc... functions directly. So when native is enabled (which is our default) we can do it properly (though I am guessing we don't currently). when jruby.native.enabled=false it will be pure Java and broken...which is ok since Java does not currently give us the power.

        Show
        Thomas E Enebo added a comment - Our jnr-posix library gives us the ability to call windows Kernel32, etc... functions directly. So when native is enabled (which is our default) we can do it properly (though I am guessing we don't currently). when jruby.native.enabled=false it will be pure Java and broken...which is ok since Java does not currently give us the power.
        Hide
        Charles Oliver Nutter added a comment -

        So there's the marching orders: figure out the proper logic and help us bind it into jnr-posix

        https://github.com/jnr/jnr-posix

        Show
        Charles Oliver Nutter added a comment - So there's the marching orders: figure out the proper logic and help us bind it into jnr-posix https://github.com/jnr/jnr-posix
        Hide
        Luca Simone added a comment -

        Ok, I've done some research and study about jna and jnr-posix.
        It seems ok, the function _wchmod mapped to the native library return 0, but we need a method to map Windows permissions to posix permissions. I would like to know what do you think about and how to continue, thx

        https://github.com/lukefx/jnr-posix/commit/5214549526a40338028becf846db4dc90481b207

        Show
        Luca Simone added a comment - Ok, I've done some research and study about jna and jnr-posix. It seems ok, the function _wchmod mapped to the native library return 0, but we need a method to map Windows permissions to posix permissions. I would like to know what do you think about and how to continue, thx https://github.com/lukefx/jnr-posix/commit/5214549526a40338028becf846db4dc90481b207
        Hide
        Luca Simone added a comment -

        Update, I've send a pull request because now the spec pass for me on Windows

        https://github.com/wmeissner/jnr-posix/pull/2

        Show
        Luca Simone added a comment - Update, I've send a pull request because now the spec pass for me on Windows https://github.com/wmeissner/jnr-posix/pull/2
        Hide
        Charles Oliver Nutter added a comment -

        Looks like we need jnr-posix to incoporate Luca's changes for this one. Marking for 1.6, but may not make RC3 (todayish).

        Show
        Charles Oliver Nutter added a comment - Looks like we need jnr-posix to incoporate Luca's changes for this one. Marking for 1.6, but may not make RC3 (todayish).
        Hide
        Luca Simone added a comment -

        I've already done a pull request to jruby/jnr-posix. Ready to merge

        Show
        Luca Simone added a comment - I've already done a pull request to jruby/jnr-posix. Ready to merge
        Hide
        Charles Oliver Nutter added a comment -

        Looks like this fell through the cracks. Patch provided for jnr-posix, just need to pull it in?

        Show
        Charles Oliver Nutter added a comment - Looks like this fell through the cracks. Patch provided for jnr-posix, just need to pull it in?
        Hide
        Charles Oliver Nutter added a comment -

        Marked as blocker for 1.6.4, so it doesn't fall again.

        Show
        Charles Oliver Nutter added a comment - Marked as blocker for 1.6.4, so it doesn't fall again.
        Hide
        Thomas E Enebo added a comment -

        Applied to next upcoming version of jnr-posix for 1.6.x and also different jnr-posix being used for master. Thanks lukefx.

        Show
        Thomas E Enebo added a comment - Applied to next upcoming version of jnr-posix for 1.6.x and also different jnr-posix being used for master. Thanks lukefx.

          People

          • Assignee:
            Thomas E Enebo
            Reporter:
            Vladimir Sizikov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: