FileUtils.chown_R produces ArgumentError when the directory contains a symlink
------------------------------------------------------------------------------
Key: JRUBY-3761
URL: http://jira.codehaus.org/browse/JRUBY-3761
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.2
Environment: Darwin lunchbox.local 9.7.0 Darwin Kernel Version 9.7.0:
Tue Mar 31 22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-206)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-82, mixed mode)
jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-06-10 rev 6586) [x86_64-java]
Reporter: Coda Hale
Priority: Minor
Given a directory structure like this:
LUNCHBOX ~/test> ls -alh
total 4.0K
drwxr-xr-x 6 coda staff 204 2009-06-15 22:33 .
drwx------+ 87 coda staff 2.9K 2009-06-15 22:32 ..
lrwxr-xr-x 1 coda staff 3 2009-06-15 22:33 four -> two
drwxr-xr-x 2 coda staff 68 2009-06-15 22:32 one
drwxr-xr-x 2 coda staff 68 2009-06-15 22:32 three
drwxr-xr-x 2 coda staff 68 2009-06-15 22:32 two
This code:
FileUtils.chown_R("coda", nil, "/Users/coda/test", :verbose => false)
raises an ArgmentException:
/opt/local/share/java/jruby/lib/ruby/1.8/fileutils.rb:1374:in
`check_have_lchown?': wrong # of arguments(2 for 3) (ArgumentError)
from /opt/local/share/java/jruby/lib/ruby/1.8/fileutils.rb:1367:in
`have_lchown?'
from /opt/local/share/java/jruby/lib/ruby/1.8/fileutils.rb:1222:in
`chown'
from /opt/local/share/java/jruby/lib/ruby/1.8/fileutils.rb:961:in
`chown_R'
from /opt/local/share/java/jruby/lib/ruby/1.8/fileutils.rb:1324:in
`preorder_traverse'
from /opt/local/share/java/jruby/lib/ruby/1.8/fileutils.rb:959:in
`chown_R'
from /opt/local/share/java/jruby/lib/ruby/1.8/fileutils.rb:958:in `each'
from /opt/local/share/java/jruby/lib/ruby/1.8/fileutils.rb:958:in
`chown_R'
The same code in Ruby does not. The exception is only raised when there are
symbolic links in the path to be chown'd.
--
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