Skip to content

Commit 940bf97

Browse files
authored
Merge pull request #1128 from giuseppe/move-set_dumpable-after-userns-creation
linux: move PR_SET_DUMPABLE after userns creation
2 parents e6c1ca3 + 8363deb commit 940bf97

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcrun/linux.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4146,10 +4146,6 @@ init_container (libcrun_container_t *container, int sync_socket_container, struc
41464146
int ret;
41474147
const char success = 0;
41484148

4149-
ret = prctl (PR_SET_DUMPABLE, 0, 0, 0, 0);
4150-
if (UNLIKELY (ret < 0))
4151-
return crun_make_error (err, errno, "prctl (PR_SET_DUMPABLE)");
4152-
41534149
if (init_status->idx_pidns_to_join_immediately >= 0 || init_status->idx_timens_to_join_immediately >= 0)
41544150
{
41554151
pid_t new_pid;
@@ -4296,6 +4292,10 @@ init_container (libcrun_container_t *container, int sync_socket_container, struc
42964292
}
42974293
}
42984294

4295+
ret = prctl (PR_SET_DUMPABLE, 0, 0, 0, 0);
4296+
if (UNLIKELY (ret < 0))
4297+
return crun_make_error (err, errno, "prctl (PR_SET_DUMPABLE)");
4298+
42994299
if (init_status->must_fork)
43004300
{
43014301
/* A PID and a time namespace are joined when the new process is created. */

0 commit comments

Comments
 (0)