From: Michael Tremer Date: Sat, 12 Oct 2024 14:37:26 +0000 (+0000) Subject: jail: Wait a little bit later in the child process X-Git-Tag: 0.9.30~1076 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d784a96e63f91e6fe83018d94f8e66e3d55ba3e;p=pakfire.git jail: Wait a little bit later in the child process That way, we can set for the child process to die before we start waiting. Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/jail.c b/src/libpakfire/jail.c index 68522ecaa..71612ca9d 100644 --- a/src/libpakfire/jail.c +++ b/src/libpakfire/jail.c @@ -1124,11 +1124,6 @@ static int pakfire_jail_child(struct pakfire_jail* jail, struct pakfire_jail_exe CTX_DEBUG(jail->ctx, "Launched child process in jail with PID %d\n", pid); - // Wait for the parent to finish initialization - r = pakfire_jail_wait_for_signal(jail, ctx->completed_fd); - if (r) - return r; - // Die with parent r = prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); if (r) { @@ -1150,6 +1145,11 @@ static int pakfire_jail_child(struct pakfire_jail* jail, struct pakfire_jail_exe return 126; } + // Wait for the parent to finish initialization + r = pakfire_jail_wait_for_signal(jail, ctx->completed_fd); + if (r) + return r; + // Fetch UID/GID uid_t uid = getuid(); gid_t gid = getgid();