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

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