This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients desbma, giampaolo.rodola, gregory.p.smith, izbyshev, patrick.mclean, rhettinger, twouters, vstinner
Date 2019-09-25.10:55:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1569408938.61.0.651914697971.issue36046@roundup.psfhosted.org>
In-reply-to
Content
Hum, this change has a big (security?) issue:

import subprocess
subprocess.Popen(["/usr/bin/id"], user=1000, group=1000).wait()

gives:

uid=1000(vstinner) gid=1000(vstinner) groupes=1000(vstinner),0(root) contexte=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

But:

import subprocess
subprocess.Popen(["/usr/bin/id"], user=1000, group=1000, close_fds=False).wait()

gives:

uid=0(root) gid=0(root) groupes=0(root) contexte=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

=> user and group arguments are ignored when using close_fds=False: when subprocess uses posix_spawn().


Note: test_subprocess test_group() is skipped on my Fedora 30.


I wrote PR 16384 to fix the bug and enable test_group() on my Fedora (check also for "nobody" and "nfsnobody" groups).
History
Date User Action Args
2019-09-25 10:55:38vstinnersetrecipients: + vstinner, twouters, rhettinger, gregory.p.smith, giampaolo.rodola, desbma, izbyshev, patrick.mclean
2019-09-25 10:55:38vstinnersetmessageid: <1569408938.61.0.651914697971.issue36046@roundup.psfhosted.org>
2019-09-25 10:55:38vstinnerlinkissue36046 messages
2019-09-25 10:55:38vstinnercreate