diff options
author | 2022-06-08 15:42:35 +0200 | |
---|---|---|
committer | 2022-06-08 15:42:35 +0200 | |
commit | 1884ea22a90d225950d81c804f1771b42ae55f54 (patch) | |
tree | a8443ae52a480850d13a60e0a190d0d2a995d4e2 /src | |
parent | CVE-2022-31214: fixing the fix (diff) | |
download | firejail-1884ea22a90d225950d81c804f1771b42ae55f54.tar.gz firejail-1884ea22a90d225950d81c804f1771b42ae55f54.tar.zst firejail-1884ea22a90d225950d81c804f1771b42ae55f54.zip |
CVE-2022-31214: fixing the fix, one more time
the previous commit "CVE-2022-31214: fixing the fix"
made private-etc=fonts,fonts and similar commands
fail with an error
fix that regression by tolerating already existing
directories
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/fs_etc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/firejail/fs_etc.c b/src/firejail/fs_etc.c index e87d3b726..77fa00d6b 100644 --- a/src/firejail/fs_etc.c +++ b/src/firejail/fs_etc.c | |||
@@ -104,7 +104,10 @@ static void build_dirs(char *src, char *dst, size_t src_prefix_len, size_t dst_p | |||
104 | *q = '\0'; | 104 | *q = '\0'; |
105 | *r = '/'; | 105 | *r = '/'; |
106 | r = q; | 106 | r = q; |
107 | mkdir_attr(dst, s.st_mode, 0, 0); | 107 | if (mkdir(dst, 0700) != 0 && errno != EEXIST) |
108 | errExit("mkdir"); | ||
109 | if (chmod(dst, s.st_mode) != 0) | ||
110 | errExit("chmod"); | ||
108 | } | 111 | } |
109 | if (!last) { | 112 | if (!last) { |
110 | // If we're not at the final terminating null, restore | 113 | // If we're not at the final terminating null, restore |