util-linux/0206-su-add-segmentation-fault-reporting-of-the-child-pro.patch
Karel Zak 7443d56081 2.22.1-3: enable su(1) and runuser(1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-01 15:09:04 +01:00

41 lines
1.2 KiB
Diff

From 1fe22a730b1a6595c6da9ea8cd58594337e66dc3 Mon Sep 17 00:00:00 2001
From: Ondrej Oprala <ooprala@redhat.com>
Date: Tue, 11 Sep 2012 16:39:17 +0200
Subject: [PATCH 206/208] su: add segmentation fault reporting of the child
process
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/login-utils/su-common.c b/login-utils/su-common.c
index 778738f..118e080 100644
--- a/login-utils/su-common.c
+++ b/login-utils/su-common.c
@@ -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
--
1.7.11.7