aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-08-11 08:09:29 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-08-11 08:09:29 -0400
commit74e2739460637e8200bdbfbb8ca0d66599d24366 (patch)
treeb31e7d0f7e556fccba15c93d681edd5742c16b73
parentfixing issues 2 and 4 (diff)
downloadfirejail-74e2739460637e8200bdbfbb8ca0d66599d24366.tar.gz
firejail-74e2739460637e8200bdbfbb8ca0d66599d24366.tar.zst
firejail-74e2739460637e8200bdbfbb8ca0d66599d24366.zip
tenative fix for issue 11
-rw-r--r--src/firejail/fs_var.c14
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
296void fs_var_tmp(void) { 296void 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");