diff --git a/src/firejail/fs_home.c b/src/firejail/fs_home.c index 75c4b7da3..86e6b0949 100644 --- a/src/firejail/fs_home.c +++ b/src/firejail/fs_home.c @@ -291,7 +291,7 @@ void fs_private_homedir(void) { errExit("mounting home directory"); fs_logger("tmpfs /root"); } - else { + if (u == 0 || strncmp(homedir, "/home/", 6) != 0) { // mask /home if (arg_debug) printf("Mounting a new /home directory\n"); @@ -567,7 +567,7 @@ void fs_private_home_list(void) { if (mount("tmpfs", "/root", "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME, "mode=700,gid=0") < 0) errExit("mounting home directory"); } - else { + if (uid == 0 || strncmp(homedir, "/home/", 6) != 0) { // mask /home if (arg_debug) printf("Mounting a new /home directory\n");