diff options
Diffstat (limited to 'src/firejail/util.c')
-rw-r--r-- | src/firejail/util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/firejail/util.c b/src/firejail/util.c index 4384c2b0b..8d3b9d3cd 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c | |||
@@ -698,8 +698,8 @@ void flush_stdin(void) { | |||
698 | 698 | ||
699 | void create_empty_dir_as_root(const char *dir, mode_t mode) { | 699 | void create_empty_dir_as_root(const char *dir, mode_t mode) { |
700 | assert(dir); | 700 | assert(dir); |
701 | |||
702 | struct stat s; | 701 | struct stat s; |
702 | |||
703 | if (stat(dir, &s)) { | 703 | if (stat(dir, &s)) { |
704 | if (arg_debug) | 704 | if (arg_debug) |
705 | printf("Creating empty %s directory\n", dir); | 705 | printf("Creating empty %s directory\n", dir); |
@@ -707,9 +707,10 @@ void create_empty_dir_as_root(const char *dir, mode_t mode) { | |||
707 | errExit("mkdir"); | 707 | errExit("mkdir"); |
708 | if (chmod(dir, mode) == -1) | 708 | if (chmod(dir, mode) == -1) |
709 | errExit("chmod"); | 709 | errExit("chmod"); |
710 | if (chown(dir, 0, 0) == -1) | ||
711 | errExit("chown"); | ||
710 | ASSERT_PERMS(dir, 0, 0, mode); | 712 | ASSERT_PERMS(dir, 0, 0, mode); |
711 | } | 713 | } |
712 | |||
713 | } | 714 | } |
714 | 715 | ||
715 | void create_empty_file_as_root(const char *fname, mode_t mode) { | 716 | void create_empty_file_as_root(const char *fname, mode_t mode) { |