summaryrefslogtreecommitdiff
path: root/pkg/rootless/rootless_linux.c
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-07-30 21:45:41 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-07-30 21:46:04 +0200
commitd86ef45441635bf12a9ba78ace91050622a5eac3 (patch)
treee80de4a52ccfa6526fd8c3a046c861293a86865f /pkg/rootless/rootless_linux.c
parent8408cfd35c8aaa8cfcd08ee8b0874442f7430ede (diff)
downloadpodman-d86ef45441635bf12a9ba78ace91050622a5eac3.tar.gz
podman-d86ef45441635bf12a9ba78ace91050622a5eac3.tar.bz2
podman-d86ef45441635bf12a9ba78ace91050622a5eac3.zip
rootless: child exits immediately on userns errors
if the parent process failed to create the user namespace, let the child exit immediately. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/rootless/rootless_linux.c')
-rw-r--r--pkg/rootless/rootless_linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/rootless/rootless_linux.c b/pkg/rootless/rootless_linux.c
index d3e43e44d..eaf2d4551 100644
--- a/pkg/rootless/rootless_linux.c
+++ b/pkg/rootless/rootless_linux.c
@@ -860,7 +860,7 @@ reexec_in_user_namespace (int ready, char *pause_pid_file_path, char *file_to_re
fprintf (stderr, "cannot read from sync pipe: %s\n", strerror (errno));
_exit (EXIT_FAILURE);
}
- if (b != '0')
+ if (ret != 1 || b != '0')
_exit (EXIT_FAILURE);
if (syscall_setresgid (0, 0, 0) < 0)