]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su: add segmentation fault reporting of the child process
authorOndrej Oprala <ooprala@redhat.com>
Tue, 11 Sep 2012 14:39:17 +0000 (16:39 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 21 Sep 2012 10:37:18 +0000 (12:37 +0200)
Child processes that ended with segmentation fault previously
indicated this with return status only. The report is now more
verbose if core dump is allowed.

Improved-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
login-utils/su-common.c

index 23ad57dc3ecd74def3591dae218b70cf6de2bba6..2749303136087ec487aeea6ad0247dea237afe6c 100644 (file)
@@ -300,7 +300,12 @@ create_watching_parent (void)
        }
       if (pid != (pid_t)-1)
        if (WIFSIGNALED (status))
-         status = WTERMSIG (status) + 128;
+         {
+           status = WTERMSIG (status) + 128;
+           if (WCOREDUMP (status))
+             fprintf (stderr, _("%s (core dumped)\n"),
+                 strsignal (WTERMSIG (status)));
+         }
        else
          status = WEXITSTATUS (status);
       else