mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Don't install a preexec_fn by default
ipautil.run() now only installs a preexec_fn when it is actually needed. This addresses a compatibility issue with mod_wsgi subinterpreters under Python 3.8. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1759290 See: https://bugs.python.org/issue37951 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
c77bbe7899
commit
0b8c81a5bc
@ -515,14 +515,18 @@ def run(args, stdin=None, raiseonerr=True, nolog=(), env=None,
|
|||||||
for group, gid in zip(suplementary_groups, suplementary_gids):
|
for group, gid in zip(suplementary_groups, suplementary_gids):
|
||||||
logger.debug('suplementary_group=%s (GID %d)', group, gid)
|
logger.debug('suplementary_group=%s (GID %d)', group, gid)
|
||||||
|
|
||||||
def preexec_fn():
|
if runas is not None or umask is not None:
|
||||||
if runas is not None:
|
# preexec function is not supported in WSGI environment
|
||||||
os.setgroups(suplementary_gids)
|
def preexec_fn():
|
||||||
os.setregid(pent.pw_gid, pent.pw_gid)
|
if runas is not None:
|
||||||
os.setreuid(pent.pw_uid, pent.pw_uid)
|
os.setgroups(suplementary_gids)
|
||||||
|
os.setregid(pent.pw_gid, pent.pw_gid)
|
||||||
|
os.setreuid(pent.pw_uid, pent.pw_uid)
|
||||||
|
|
||||||
if umask:
|
if umask is not None:
|
||||||
os.umask(umask)
|
os.umask(umask)
|
||||||
|
else:
|
||||||
|
preexec_fn = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# pylint: disable=subprocess-popen-preexec-fn
|
# pylint: disable=subprocess-popen-preexec-fn
|
||||||
|
Loading…
Reference in New Issue
Block a user