From: Felix Abecassis Date: Tue, 12 Mar 2019 00:13:48 +0000 (-0700) Subject: utils: fix handling of PID namespaces in lxc_set_death_signal X-Git-Tag: lxc-3.2.0~115^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e610509377359ca6da95cd7ca9d761c0c3489c7;p=thirdparty%2Flxc.git utils: fix handling of PID namespaces in lxc_set_death_signal Signed-off-by: Felix Abecassis --- 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;