1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/ruby/test_file_exhaustive.rb: check the owner of the root directory

The root directory may be owned by the current user, for example, in
chroot environment.
This commit is contained in:
Yusuke Endoh 2019-10-10 23:18:44 +09:00
parent c144d7215b
commit a886d5cb79

View file

@ -70,7 +70,7 @@ class TestFileExhaustive < Test::Unit::TestCase
def notownedfile
return @notownedfile if defined? @notownedfile
if Process.euid != 0
if Process.euid != File.stat("/").uid
@notownedfile = '/'
else
@notownedfile = nil