Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.7, JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre2
    • Component/s: None
    • Labels:
      None
    • Environment:
      OSX
    • Number of attachments :
      0

      Description

      > touch TEST
      > ln -s TEST TEST_SYMLINK
      > jruby -rfileutils -e 'FileUtils.chmod(0, "TEST_SYMLINK")'
      ArgumentError: wrong number of arguments (1 for 2)
        check_have_lchmod? at /Users/xavier/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/1.9/fileutils.rb:1474
              have_lchmod? at /Users/xavier/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/1.9/fileutils.rb:1467
                     chmod at /Users/xavier/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/1.9/fileutils.rb:1330
                     chmod at /Users/xavier/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/1.9/fileutils.rb:979
                      each at org/jruby/RubyArray.java:1611
                     chmod at /Users/xavier/.rvm/rubies/jruby-1.7.0.preview1/lib/ruby/1.9/fileutils.rb:978
                    (root) at -e:1
      

      fileutils.rb:1474 looks weird to me. Why call the method with one argument after checking respond_to?

      This case works on CRuby 1.9, even though docs specify 2 arguments: http://ruby-doc.org/core-1.9.3/File.html#method-c-lchmod

      Maybe related to JRUBY-5747?

        Activity

        Hide
        Xavier Shay added a comment -

        For reference, we hit this bug trying to install a gem that had a symlink in the bin directory.

        Show
        Xavier Shay added a comment - For reference, we hit this bug trying to install a gem that had a symlink in the bin directory.
        Hide
        Charles Oliver Nutter added a comment -

        A gem that shipped with a symlink in the bin dir? How is that even legal? It wouldn't work on Windows, after all...

        Investigating.

        Show
        Charles Oliver Nutter added a comment - A gem that shipped with a symlink in the bin dir? How is that even legal? It wouldn't work on Windows, after all... Investigating.
        Hide
        Charles Oliver Nutter added a comment -

        Ok, this might be pretty simple...our lchmod needs to support a 1-arg format apparently.

        Show
        Charles Oliver Nutter added a comment - Ok, this might be pretty simple...our lchmod needs to support a 1-arg format apparently.
        Hide
        Charles Oliver Nutter added a comment -

        We probably should have a test for this somewhere...RubySpec? MRI suite?

        commit 35604c28471d944def6404f7c8900293cfe0a5b9
        Author: Charles Oliver Nutter <headius@headius.com>
        Date:   Thu Jun 28 18:14:48 2012 -0500
        
            Fix JRUBY-6735: FileUtils.chmod broken for symlinks
            
            File.lchmod only requires one argument -- the mode -- and just
            does nothing if passed no paths.
        
        Show
        Charles Oliver Nutter added a comment - We probably should have a test for this somewhere...RubySpec? MRI suite? commit 35604c28471d944def6404f7c8900293cfe0a5b9 Author: Charles Oliver Nutter <headius@headius.com> Date: Thu Jun 28 18:14:48 2012 -0500 Fix JRUBY-6735: FileUtils.chmod broken for symlinks File.lchmod only requires one argument -- the mode -- and just does nothing if passed no paths.
        Hide
        Xavier Shay added a comment -

        No an internal thing. I got it fixed quick smart.

        Show
        Xavier Shay added a comment - No an internal thing. I got it fixed quick smart.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Xavier Shay
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: