mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
versions of python < 2.6.2 don't manage unsigned int for groups like on osx or fedora
s Please enter the commit message for your changes. Lines starting
This commit is contained in:
parent
316e943609
commit
40514ca2eb
@ -3,7 +3,7 @@
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
|
||||
import ctypes
|
||||
import grp
|
||||
import logging
|
||||
import optparse as op
|
||||
@ -106,7 +106,13 @@ def set_owner_process(user,group):
|
||||
gid = int(group)
|
||||
else:
|
||||
gid = grp.getgrnam(group).gr_gid
|
||||
|
||||
try:
|
||||
os.setgid(gid)
|
||||
except OverflowError:
|
||||
# versions of python < 2.6.2 don't manage unsigned int for
|
||||
# groups like on osx or fedora
|
||||
os.setgid(-ctypes.c_int(-gid).value)
|
||||
if user:
|
||||
if user.isdigit() or isinstance(user, int):
|
||||
uid = int(user)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user