mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/etc/test_etc.rb (test_getpwuid, test_getgrgid): use
Process.euid and egid instead of Etc.getlogin to identify current user which may be different from a login one (e.g., su command). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1f322f83e7
commit
c309cda903
2 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Thu Sep 4 00:01:45 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* test/etc/test_etc.rb (test_getpwuid, test_getgrgid): use
|
||||
Process.euid and egid instead of Etc.getlogin to identify current
|
||||
user which may be different from a login one (e.g., su command).
|
||||
|
||||
Wed Sep 3 23:52:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* test/etc/test_etc.rb: check only typical use of
|
||||
|
|
|
@ -32,7 +32,7 @@ class TestEtc < Test::Unit::TestCase
|
|||
Etc.passwd {|s| passwd[s.uid] = s unless passwd[s.uid] }
|
||||
passwd.values.each do |s|
|
||||
assert_equal(s, Etc.getpwuid(s.uid))
|
||||
assert_equal(s, Etc.getpwuid) if Etc.getlogin == s.name
|
||||
assert_equal(s, Etc.getpwuid) if Process.euid == s.uid
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -73,7 +73,7 @@ class TestEtc < Test::Unit::TestCase
|
|||
end
|
||||
groups.each do |s|
|
||||
assert_equal(s, Etc.getgrgid(s.gid))
|
||||
assert_equal(s, Etc.getgrgid) if Etc.getlogin == s.name
|
||||
assert_equal(s, Etc.getgrgid) if Process.egid == s.gid
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue