diff options
Diffstat (limited to 'src/firejail/restrict_users.c')
-rw-r--r-- | src/firejail/restrict_users.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/firejail/restrict_users.c b/src/firejail/restrict_users.c index 57e84e5cc..393851148 100644 --- a/src/firejail/restrict_users.c +++ b/src/firejail/restrict_users.c | |||
@@ -95,10 +95,8 @@ static void sanitize_home(void) { | |||
95 | fs_logger2("mkdir", cfg.homedir); | 95 | fs_logger2("mkdir", cfg.homedir); |
96 | 96 | ||
97 | // set mode and ownership | 97 | // set mode and ownership |
98 | if (chown(cfg.homedir, s.st_uid, s.st_gid) == -1) | 98 | if (set_perms(cfg.homedir, s.st_uid, s.st_gid, s.st_mode)) |
99 | errExit("chown"); | 99 | errExit("set_perms"); |
100 | if (chmod(cfg.homedir, s.st_mode) == -1) | ||
101 | errExit("chmod"); | ||
102 | 100 | ||
103 | // mount user home directory | 101 | // mount user home directory |
104 | if (mount(RUN_WHITELIST_HOME_DIR, cfg.homedir, NULL, MS_BIND|MS_REC, NULL) < 0) | 102 | if (mount(RUN_WHITELIST_HOME_DIR, cfg.homedir, NULL, MS_BIND|MS_REC, NULL) < 0) |