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

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