arrfab / rpms / abrt

Forked from rpms/abrt 5 years ago
Clone

Blame SOURCES/0223-ccpp-add-xfunc_die-if-cannot-get-executable.patch

baab13
From ec6296c489571286f6ba4dc586fdd936b899ba92 Mon Sep 17 00:00:00 2001
baab13
From: Matej Habrnal <mhabrnal@redhat.com>
baab13
Date: Thu, 21 Apr 2016 15:54:03 +0200
baab13
Subject: [PATCH] ccpp: add xfunc_die() if cannot get executable
baab13
baab13
Also remove extra checks of executable.
baab13
baab13
Related to rhbz#1277849
baab13
baab13
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
baab13
---
baab13
 src/hooks/abrt-hook-ccpp.c | 8 ++++++--
baab13
 1 file changed, 6 insertions(+), 2 deletions(-)
baab13
baab13
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
baab13
index 8afd0d3..2c05c78 100644
baab13
--- a/src/hooks/abrt-hook-ccpp.c
baab13
+++ b/src/hooks/abrt-hook-ccpp.c
baab13
@@ -839,17 +839,21 @@ int main(int argc, char** argv)
baab13
     int src_fd_binary = -1;
baab13
     char *executable = get_executable(pid, setting_SaveBinaryImage ? &src_fd_binary : NULL);
baab13
     if (executable == NULL)
baab13
+    {
baab13
         error_msg_not_process_crash(pid_str, NULL, (long unsigned)uid, signal_no,
baab13
                 signame, "ignoring (can't read /proc/PID/exe link)");
baab13
 
baab13
-    if (executable && strstr(executable, "/abrt-hook-ccpp"))
baab13
+        xfunc_die();
baab13
+    }
baab13
+
baab13
+    if (strstr(executable, "/abrt-hook-ccpp"))
baab13
     {
baab13
         error_msg_and_die("PID %lu is '%s', not dumping it to avoid recursion",
baab13
                         (long)pid, executable);
baab13
     }
baab13
 
baab13
     const char *last_slash = strrchr(executable, '/');
baab13
-    if (executable && is_path_ignored(setting_ignored_paths, executable))
baab13
+    if (is_path_ignored(setting_ignored_paths, executable))
baab13
     {
baab13
         error_msg_not_process_crash(pid_str, last_slash + 1, (long unsigned)uid, signal_no,
baab13
                 signame, "ignoring (listed in 'IgnoredPaths')");
baab13
-- 
baab13
1.8.3.1
baab13