[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #61621] unshare -Upf no longer works on make unless --disable-posix
From: |
Paul D. Smith |
Subject: |
[bug #61621] unshare -Upf no longer works on make unless --disable-posix-spawn is given |
Date: |
Sun, 5 Dec 2021 14:17:22 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36 |
Follow-up Comment #1, bug #61621 (project make):
After investigation is appears that the POSIX_SPAWN_RESETIDS flag is causing
the problem. Applying this patch solved it for me:
diff --git a/src/job.c b/src/job.c
index 54fadf00..9d97fc44 100644
--- a/src/job.c
+++ b/src/job.c
@@ -2359,8 +2359,8 @@ child_execute_job (struct childbase *child, int
good_stdin, char **argv)
if ((r = posix_spawn_file_actions_adddup2 (&fa, fderr, FD_STDERR)) != 0)
goto cleanup;
- /* Be the user, permanently. */
- flags |= POSIX_SPAWN_RESETIDS;
+ /* We can't use the POSIX_SPAWN_RESETIDS flag: when make is invoked under
+ restrictive environments like unshare it will fail with EINVAL. */
/* Apply the spawn flags. */
if ((r = posix_spawnattr_setflags (&attr, flags)) != 0)
I think this change should be OK, since it doesn't do any more or less than
make would normally do when running a command.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?61621>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/