mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Check for the privileges by the current process groups
Group membership of login user is not activated until login after adding to the group.
This commit is contained in:
parent
3b86ec2251
commit
b89f6ac843
1 changed files with 1 additions and 3 deletions
|
@ -19,9 +19,7 @@ if RUBY_PLATFORM =~ /linux/
|
|||
impl = :stap
|
||||
begin
|
||||
require 'etc'
|
||||
login = Etc.getlogin
|
||||
ok = Etc.getgrnam('stapusr').mem.include?(login) &&
|
||||
Etc.getgrnam('stapdev').mem.include?(login)
|
||||
ok = (%w[stapusr stapdev].map {|g|Etc.getgrnam(g).gid} & Process.groups).size == 2
|
||||
rescue LoadError, ArgumentError
|
||||
end unless ok
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue