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

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