]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-94632: document the subprocess need for extra_groups=() with user= (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 5 Apr 2026 18:14:03 +0000 (20:14 +0200)
committerGitHub <noreply@github.com>
Sun, 5 Apr 2026 18:14:03 +0000 (18:14 +0000)
gh-94632: document the subprocess need for extra_groups=() with user= (GH-148129)
(cherry picked from commit a1cf4430ed89ec702528ef074138c407ccf89946)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Doc/library/subprocess.rst

index 4b2a1a9f658601f191bbabc5cfbb8a3c784a28ab..0dbfcdbf7308ce5660732b1ff202f00a57045d50 100644 (file)
@@ -630,6 +630,12 @@ functions.
    the value in ``pw_uid`` will be used. If the value is an integer, it will
    be passed verbatim. (POSIX only)
 
+   .. note::
+
+      Specifying *user* will not drop existing supplementary group memberships!
+      The caller must also pass ``extra_groups=()`` to reduce the group membership
+      of the child process for security purposes.
+
    .. availability:: POSIX
    .. versionadded:: 3.9