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

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