From c7b6403ae5fa4ae6f581b45d0e34a9ffe149c3a3 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 2 Aug 2018 14:26:40 +0200 Subject: [PATCH] rootless: do not segfault if the parent already died Closes: https://github.com/projectatomic/libpod/issues/1189 Signed-off-by: Giuseppe Scrivano --- pkg/rootless/rootless_linux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/rootless/rootless_linux.c b/pkg/rootless/rootless_linux.c index 465feeb57b..84fac238f9 100644 --- a/pkg/rootless/rootless_linux.c +++ b/pkg/rootless/rootless_linux.c @@ -97,6 +97,8 @@ reexec_in_user_namespace(int ready) return pid; argv = get_cmd_line_args (ppid); + if (argv == NULL) + _exit (EXIT_FAILURE); setenv ("_LIBPOD_USERNS_CONFIGURED", "init", 1); setenv ("_LIBPOD_ROOTLESS_UID", uid, 1);