From 74e2739460637e8200bdbfbb8ca0d66599d24366 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 11 Aug 2015 08:09:29 -0400 Subject: tenative fix for issue 11 --- src/firejail/fs_var.c | 14 ++++++++------ 1 file 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) { } void fs_var_tmp(void) { - - if (!is_link("/var/tmp")) { - if (arg_debug) - printf("Mounting tmpfs on /var/tmp\n"); - if (mount("tmpfs", "/var/tmp", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=777,gid=0") < 0) - errExit("mounting /var/tmp"); + struct stat s; + if (stat("/var/tmp", &s) == 0) { + if (!is_link("/var/tmp")) { + if (arg_debug) + printf("Mounting tmpfs on /var/tmp\n"); + if (mount("tmpfs", "/var/tmp", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=777,gid=0") < 0) + errExit("mounting /var/tmp"); + } } else { fprintf(stderr, "Warning: /var/tmp not mounted\n"); -- cgit v1.2.3-54-g00ecf