doczkal / rpms / abrt

Forked from rpms/abrt 4 years ago
Clone

Blame SOURCES/0103-ccpp-avoid-overriding-system-files-by-coredump.patch

a60cd7
From cdb4c5b0855d910132e61d71afbd445b0271fcb4 Mon Sep 17 00:00:00 2001
a60cd7
From: Jakub Filak <jfilak@redhat.com>
a60cd7
Date: Tue, 21 Apr 2015 07:54:17 +0200
a60cd7
Subject: [ABRT PATCH] ccpp: avoid overriding system files by coredump
a60cd7
a60cd7
Related: #1211835
a60cd7
a60cd7
Signed-off-by: Jakub Filak <jfilak@redhat.com>
a60cd7
---
a60cd7
 src/hooks/abrt-hook-ccpp.c | 2 +-
a60cd7
 1 file changed, 1 insertion(+), 1 deletion(-)
a60cd7
a60cd7
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
a60cd7
index 3a6d002..02f15d5 100644
a60cd7
--- a/src/hooks/abrt-hook-ccpp.c
a60cd7
+++ b/src/hooks/abrt-hook-ccpp.c
a60cd7
@@ -544,7 +544,7 @@ static bool dump_fd_info(const char *dest_filename, char *source_filename, int s
a60cd7
 /* Like xopen, but on error, unlocks and deletes dd and user core */
a60cd7
 static int create_or_die(const char *filename)
a60cd7
 {
a60cd7
-    int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, DEFAULT_DUMP_DIR_MODE);
a60cd7
+    int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, DEFAULT_DUMP_DIR_MODE);
a60cd7
     if (fd >= 0)
a60cd7
     {
a60cd7
         IGNORE_RESULT(fchown(fd, dd->dd_uid, dd->dd_gid));
a60cd7
-- 
a60cd7
1.8.3.1
a60cd7