From 7e610509377359ca6da95cd7ca9d761c0c3489c7 Mon Sep 17 00:00:00 2001 From: Felix Abecassis Date: Mon, 11 Mar 2019 17:13:48 -0700 Subject: [PATCH] utils: fix handling of PID namespaces in lxc_set_death_signal Signed-off-by: Felix Abecassis --- src/lxc/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/utils.c b/src/lxc/utils.c index e2b2bb11e..0262c7acd 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1705,9 +1705,9 @@ int lxc_set_death_signal(int signal, pid_t parent) ret = prctl(PR_SET_PDEATHSIG, prctl_arg(signal), prctl_arg(0), prctl_arg(0), prctl_arg(0)); - /* Check whether we have been orphaned. */ + /* If not in a PID namespace, check whether we have been orphaned. */ ppid = (pid_t)syscall(SYS_getppid); - if (ppid != parent) { + if (ppid && ppid != parent) { ret = raise(SIGKILL); if (ret < 0) return -1; -- 2.47.2