summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-09-25 13:52:49 (GMT)
committerT. Wouters <thomas@python.org>2019-09-25 13:52:49 (GMT)
commitfaca8553425c231d867dcabf6a69a9dd21118b6c (patch)
tree1a6288fd61a3e8ef1db02dd660cbe3b4b5af642a /Lib/subprocess.py
parent1dc1acbd73f05f14c974b7ce1041787d7abef31e (diff)
downloadcpython-faca8553425c231d867dcabf6a69a9dd21118b6c.zip
cpython-faca8553425c231d867dcabf6a69a9dd21118b6c.tar.gz
cpython-faca8553425c231d867dcabf6a69a9dd21118b6c.tar.bz2
bpo-36046: posix_spawn() doesn't support uid/gid (GH-16384)
* subprocess.Popen now longer uses posix_spawn() if uid, gid or gids are set. * test_subprocess: add "nobody" and "nfsnobody" group names for test_group(). * test_subprocess: test_user() and test_group() are now also tested with close_fds=False.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 85e7969..1016874 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1681,7 +1681,10 @@ class Popen(object):
and (p2cread == -1 or p2cread > 2)
and (c2pwrite == -1 or c2pwrite > 2)
and (errwrite == -1 or errwrite > 2)
- and not start_new_session):
+ and not start_new_session
+ and gid is None
+ and gids is None
+ and uid is None):
self._posix_spawn(args, executable, env, restore_signals,
p2cread, p2cwrite,
c2pread, c2pwrite,