Skip to content

Commit d6e2f6f

Browse files
author
Jakub Filak
committed
ccpp: open file for dump_fd_info with O_EXCL
To avoid possible races. Related: #1211835 Signed-off-by: Jakub Filak <jfilak@redhat.com>
1 parent 4f2c1dd commit d6e2f6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/hooks/abrt-hook-ccpp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static int open_user_core(uid_t uid, uid_t fsuid, pid_t pid, char **percent_valu
399399

400400
static bool dump_fd_info(const char *dest_filename, char *source_filename, int source_base_ofs, uid_t uid, gid_t gid)
401401
{
402-
FILE *fp = fopen(dest_filename, "w");
402+
FILE *fp = fopen(dest_filename, "wx");
403403
if (!fp)
404404
return false;
405405

0 commit comments

Comments
 (0)