Issue #238 has been updated by Jim Deville.


> This is ruby, not shell :)

Agreed, but I don't think you should be able to circumvent permissions by going into Ruby.

> If you think it's wrong that ruby can remove read-only file on every platforms, it opens to dispute (and it's not my -- windows port mainterner's issue but matz's and others').

I'm up for disputing it. Especially considering the following:

mkdir foo
james@james-devilles-macbook-pro:/private/tmp/test $ 
chmod a-wrx foo
james@james-devilles-macbook-pro:/private/tmp/test $ 
sudo chown root foo
james@james-devilles-macbook-pro:/private/tmp/test $ 
ll
total 0
drwxr-xr-x  3 james  wheel  102 Jul 10 09:22 ./
drwxrwxrwt  9 root   wheel  306 Jul 10 09:18 ../
d---------  2 root   wheel   68 Jul 10 09:22 foo/
james@james-devilles-macbook-pro:/private/tmp/test $ 
ruby -e "Dir.delete 'foo'"
james@james-devilles-macbook-pro:/private/tmp/test $ 
ls
james@james-devilles-macbook-pro:/private/tmp/test $ 
ll
total 0
drwxr-xr-x  2 james  wheel   68 Jul 10 09:22 ./
drwxrwxrwt  9 root   wheel  306 Jul 10 09:18 ../
james@james-devilles-macbook-pro:/private/tmp/test $ 

Ruby (without elevation) shouldn't be able to delete root's files. Additionally, I don't think it should ever change permissions on a file without me explicitly asking it to. This might be a considered a security risk by some.

For Dir.mkdir, I'd like to see it act the same on all platforms, but I understand that it's a cost.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/238

----------------------------------------
http://redmine.ruby-lang.org