From 8966d851bef4a0406bd55835f3bf5cd6ba0a6aec Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sun, 5 Apr 2026 10:40:33 -0700 Subject: [PATCH] gh-94632: document the subprocess need for extra_groups=() with user= --- Doc/library/subprocess.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 9e261a0ca03902..fe64daa3291d67 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -627,6 +627,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