mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
mongrel can use all group permissions of this user. (#14116)
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@589 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
parent
49fb382f99
commit
f540b48bf3
1 changed files with 5 additions and 0 deletions
|
@ -55,6 +55,11 @@ module Mongrel
|
|||
# Change privilege of the process to specified user and group.
|
||||
def change_privilege(user, group)
|
||||
begin
|
||||
if group && user
|
||||
log "Initializing groups for #{user}:#{group}."
|
||||
Process.initgroups(user, Etc.getgrnam(group).gid)
|
||||
end
|
||||
|
||||
if group
|
||||
log "Changing group to #{group}."
|
||||
Process::GID.change_privilege(Etc.getgrnam(group).gid)
|
||||
|
|
Loading…
Add table
Reference in a new issue