doczkal / rpms / abrt

Forked from rpms/abrt 4 years ago
Clone

Blame SOURCES/0092-ccpp-open-file-for-dump_fd_info-with-O_EXCL.patch

baab13
From d6e2f6f128cef4c21cb80941ae674c9842681aa7 Mon Sep 17 00:00:00 2001
baab13
From: Jakub Filak <jfilak@redhat.com>
baab13
Date: Wed, 15 Apr 2015 14:01:37 +0200
baab13
Subject: [ABRT PATCH] ccpp: open file for dump_fd_info with O_EXCL
baab13
baab13
To avoid possible races.
baab13
baab13
Related: #1211835
baab13
baab13
Signed-off-by: Jakub Filak <jfilak@redhat.com>
baab13
---
baab13
 src/hooks/abrt-hook-ccpp.c | 2 +-
baab13
 1 file changed, 1 insertion(+), 1 deletion(-)
baab13
baab13
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
baab13
index 0606519..ece1ece 100644
baab13
--- a/src/hooks/abrt-hook-ccpp.c
baab13
+++ b/src/hooks/abrt-hook-ccpp.c
baab13
@@ -399,7 +399,7 @@ static int open_user_core(uid_t uid, uid_t fsuid, pid_t pid, char **percent_valu
baab13
 
baab13
 static bool dump_fd_info(const char *dest_filename, char *source_filename, int source_base_ofs, uid_t uid, gid_t gid)
baab13
 {
baab13
-    FILE *fp = fopen(dest_filename, "w");
baab13
+    FILE *fp = fopen(dest_filename, "wx");
baab13
     if (!fp)
baab13
         return false;
baab13
 
baab13
-- 
baab13
1.8.3.1
baab13