Group permissions #1976

Closed
aumgn opened this Issue Oct 31, 2012 · 4 comments

Comments

Projects
None yet
4 participants

aumgn commented Oct 31, 2012

I have a problem related to group permissions :

>> cat /etc/os-release
NAME=Fedora
VERSION="17 (Beefy Miracle)"
ID=fedora
VERSION_ID=17
PRETTY_NAME="Fedora 17 (Beefy Miracle)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:17"

>> rvm current
rbx-head

>> ruby -v
rubinius 2.0.0dev (1.9.3 release yyyy-mm-dd JI) [i686-pc-linux-gnu]

>> id
uid=1000(aumgn) gid=1000(aumgn) groups=1000(aumgn),10(wheel),18(dialout),1001(vboxsf)

>> ll debug.rb
-rwxrwx---. 1 aumgn aumgn 10 Oct 31 14:31 debug.rb

>> cat debug.rb
puts 'Ok'

>> ruby debug.rb
Ok

>> sudo chown root:aumgn debug.rb

>> ruby debug.rb
Ok

>> sudo chown root:wheel debug.rb

>> ruby debug.rb
An exception occurred running debug.rb
    no such file to load -- debug.rb (LoadError)

Backtrace:
   Rubinius::CodeLoader#load_error at kernel/common/codeloader.rb:389
  Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:63
  Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:118
           Rubinius::Loader#script at kernel/loader.rb:614
             Rubinius::Loader#main at kernel/loader.rb:815

As shown, even if I'm part of the group wheel I can't access the debug.rb file. (This also affects 'require' and 'load')

It seems to be an issue with File::Stat#readable?

>> sudo chown root:aumgn debug.rb

>> ruby -e 'p File::Stat.stat("./debug.rb").readable?'
true

>> sudo chown root:wheel debug.rb

>> ruby -e 'p File::Stat.stat("./debug.rb").readable?'
false

Owner

dbussink commented Oct 31, 2012

What happens if you run this same code with MRI?

aumgn commented Oct 31, 2012

Both MRI (1.9.3) and JRuby (1.7.0) work as expected.

hron84 commented Nov 25, 2012

MRI 1.8.7.370 works as expected too.

@ghost ghost assigned YorickPeterse Dec 30, 2013

Owner

YorickPeterse commented Dec 30, 2013

Closing this one as it seems that the issue has been resolved. I can not reproduce this as following:

echo 'puts "hello"' > /tmp/test.rb
sudo chown root:sudo /tmp/test.rb
ruby -e 'puts File::Stat.stat("/tmp/test.rb").readable?' # => true

This was most likely fixed by #2555. Feel free to re-open if this issue still occurs on Rbx stable/master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment