aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/fs_whitelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firejail/fs_whitelist.c')
-rw-r--r--src/firejail/fs_whitelist.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c
index b0e4463ae..1794e4b35 100644
--- a/src/firejail/fs_whitelist.c
+++ b/src/firejail/fs_whitelist.c
@@ -406,10 +406,12 @@ void fs_whitelist(void) {
406 406
407 // both path and absolute path are under /home 407 // both path and absolute path are under /home
408 if (strncmp(fname, cfg.homedir, strlen(cfg.homedir)) != 0) { 408 if (strncmp(fname, cfg.homedir, strlen(cfg.homedir)) != 0) {
409 // check if the file is owned by the user 409 if (checkcfg(CFG_FOLLOW_SYMLINK_AS_USER)) {
410 struct stat s; 410 // check if the file is owned by the user
411 if (stat(fname, &s) == 0 && s.st_uid != getuid()) 411 struct stat s;
412 goto errexit; 412 if (stat(fname, &s) == 0 && s.st_uid != getuid())
413 goto errexit;
414 }
413 } 415 }
414 } 416 }
415 else if (strncmp(new_name, "/tmp/", 5) == 0) { 417 else if (strncmp(new_name, "/tmp/", 5) == 0) {