diff options
-rw-r--r-- | src/firejail/preproc.c | 4 | ||||
-rw-r--r-- | src/firejail/util.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/firejail/preproc.c b/src/firejail/preproc.c index 6784ff5ac..27e06b556 100644 --- a/src/firejail/preproc.c +++ b/src/firejail/preproc.c | |||
@@ -56,6 +56,10 @@ void preproc_build_firejail_dir(void) { | |||
56 | create_empty_dir_as_root(RUN_FIREJAIL_APPIMAGE_DIR, 0755); | 56 | create_empty_dir_as_root(RUN_FIREJAIL_APPIMAGE_DIR, 0755); |
57 | } | 57 | } |
58 | 58 | ||
59 | if (stat(RUN_MNT_DIR, &s)) { | ||
60 | create_empty_dir_as_root(RUN_MNT_DIR, 0755); | ||
61 | } | ||
62 | |||
59 | create_empty_file_as_root(RUN_RO_FILE, S_IRUSR); | 63 | create_empty_file_as_root(RUN_RO_FILE, S_IRUSR); |
60 | create_empty_dir_as_root(RUN_RO_DIR, S_IRUSR); | 64 | create_empty_dir_as_root(RUN_RO_DIR, S_IRUSR); |
61 | } | 65 | } |
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) { |