diff options
author | 2015-08-11 08:09:29 -0400 | |
---|---|---|
committer | 2015-08-11 08:09:29 -0400 | |
commit | 74e2739460637e8200bdbfbb8ca0d66599d24366 (patch) | |
tree | b31e7d0f7e556fccba15c93d681edd5742c16b73 /src | |
parent | fixing issues 2 and 4 (diff) | |
download | firejail-74e2739460637e8200bdbfbb8ca0d66599d24366.tar.gz firejail-74e2739460637e8200bdbfbb8ca0d66599d24366.tar.zst firejail-74e2739460637e8200bdbfbb8ca0d66599d24366.zip |
tenative fix for issue 11
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/fs_var.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/firejail/fs_var.c b/src/firejail/fs_var.c index ee0f81828..588090c00 100644 --- a/src/firejail/fs_var.c +++ b/src/firejail/fs_var.c | |||
@@ -294,12 +294,14 @@ void fs_var_lock(void) { | |||
294 | } | 294 | } |
295 | 295 | ||
296 | void fs_var_tmp(void) { | 296 | void fs_var_tmp(void) { |
297 | 297 | struct stat s; | |
298 | if (!is_link("/var/tmp")) { | 298 | if (stat("/var/tmp", &s) == 0) { |
299 | if (arg_debug) | 299 | if (!is_link("/var/tmp")) { |
300 | printf("Mounting tmpfs on /var/tmp\n"); | 300 | if (arg_debug) |
301 | if (mount("tmpfs", "/var/tmp", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=777,gid=0") < 0) | 301 | printf("Mounting tmpfs on /var/tmp\n"); |
302 | errExit("mounting /var/tmp"); | 302 | if (mount("tmpfs", "/var/tmp", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=777,gid=0") < 0) |
303 | errExit("mounting /var/tmp"); | ||
304 | } | ||
303 | } | 305 | } |
304 | else { | 306 | else { |
305 | fprintf(stderr, "Warning: /var/tmp not mounted\n"); | 307 | fprintf(stderr, "Warning: /var/tmp not mounted\n"); |