Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Group permissions #1976

Closed
aumgn opened this Issue · 4 comments

4 participants

@aumgn

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

@dbussink
Owner

What happens if you run this same code with MRI?

@aumgn

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

@hron84

MRI 1.8.7.370 works as expected too.

@YorickPeterse

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
Something went wrong with that request. Please try again.