diff options
Diffstat (limited to 'src/hooks')
-rw-r--r-- | src/hooks/abrt-hook-ccpp.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hooks/abrt-hook-ccpp.cpp b/src/hooks/abrt-hook-ccpp.cpp index 656d5e29..c4b71afb 100644 --- a/src/hooks/abrt-hook-ccpp.cpp +++ b/src/hooks/abrt-hook-ccpp.cpp @@ -388,14 +388,15 @@ int main(int argc, char** argv) close(fd); } - if (strstr(executable, "/abrt")) + const char *last_slash = strrchr(executable, '/'); + if (last_slash && strncmp(++last_slash, "abrt", 4)) { /* If abrtd/abrt-foo crashes, we don't want to create a _directory_, * since that can make new copy of abrtd to process it, * and maybe crash again... * Unlike dirs, mere files are ignored by abrtd. */ - snprintf(path, sizeof(path), "%s/abrt-coredump", dddir); + snprintf(path, sizeof(path), "%s/%s-coredump", dddir, last_slash); int abrt_core_fd = xopen3(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); off_t core_size = copyfd_eof(STDIN_FILENO, abrt_core_fd, COPYFD_SPARSE); if (core_size < 0 || fsync(abrt_core_fd) != 0) |