Skip to content

Commit

Permalink
log: set a more restrictive umask for new files
Browse files Browse the repository at this point in the history
  • Loading branch information
mrc0mmand committed Apr 10, 2023
1 parent 2810e5e commit ae2d98b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/log.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <sys/stat.h>

#include "log.h"

Expand All @@ -21,6 +22,8 @@ int df_log_open_log_file(const char *file_name)
{
g_assert(!log_file);

(void) umask(0022);

log_file = fopen(file_name, "a+");
if (!log_file)
return df_fail_ret(-1, "Failed to open file %s: %m\n", file_name);
Expand Down

0 comments on commit ae2d98b

Please sign in to comment.