]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
nsenter: clear SIGCHLD inherited setting
authorKarel Zak <kzak@redhat.com>
Mon, 15 Nov 2021 13:44:02 +0000 (14:44 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 15 Nov 2021 13:44:02 +0000 (14:44 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/nsenter.c

index 6bdfc0d4a4ad6dea3bd376192885a4b0335c23e8..7805703cbbe535d397a32b94f75a880e9711572b 100644 (file)
@@ -187,10 +187,14 @@ static int is_usable_namespace(pid_t target, const struct namespace_file *nsfile
 
 static void continue_as_child(void)
 {
-       pid_t child = fork();
+       pid_t child;
        int status;
        pid_t ret;
 
+       /* Clear any inherited settings */
+       signal(SIGCHLD, SIG_DFL);
+
+       child = fork();
        if (child < 0)
                err(EXIT_FAILURE, _("fork failed"));