diff options
Diffstat (limited to 'src/firejail/fs_home.c')
-rw-r--r-- | src/firejail/fs_home.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/firejail/fs_home.c b/src/firejail/fs_home.c index 0ed476063..590337da1 100644 --- a/src/firejail/fs_home.c +++ b/src/firejail/fs_home.c | |||
@@ -395,14 +395,16 @@ void fs_private(void) { | |||
395 | } | 395 | } |
396 | if (chown(homedir, u, g) < 0) | 396 | if (chown(homedir, u, g) < 0) |
397 | errExit("chown"); | 397 | errExit("chown"); |
398 | |||
399 | fs_logger2("mkdir", homedir); | 398 | fs_logger2("mkdir", homedir); |
400 | fs_logger2("tmpfs", homedir); | 399 | fs_logger2("tmpfs", homedir); |
401 | } | 400 | } |
402 | else | 401 | else { |
403 | // mask user home directory | 402 | // mask user home directory |
404 | // the directory should be owned by the current user | 403 | // the directory should be owned by the current user |
404 | EUID_USER(); | ||
405 | fs_tmpfs(homedir, 1); | 405 | fs_tmpfs(homedir, 1); |
406 | EUID_ROOT(); | ||
407 | } | ||
406 | 408 | ||
407 | selinux_relabel_path(homedir, homedir); | 409 | selinux_relabel_path(homedir, homedir); |
408 | } | 410 | } |
@@ -564,12 +566,13 @@ void fs_private_home_list(void) { | |||
564 | int xflag = store_xauthority(); | 566 | int xflag = store_xauthority(); |
565 | int aflag = store_asoundrc(); | 567 | int aflag = store_asoundrc(); |
566 | 568 | ||
567 | // create /run/firejail/mnt/home directory | ||
568 | EUID_ROOT(); | 569 | EUID_ROOT(); |
570 | // create /run/firejail/mnt/home directory | ||
569 | mkdir_attr(RUN_HOME_DIR, 0755, uid, gid); | 571 | mkdir_attr(RUN_HOME_DIR, 0755, uid, gid); |
570 | selinux_relabel_path(RUN_HOME_DIR, homedir); | 572 | selinux_relabel_path(RUN_HOME_DIR, homedir); |
571 | 573 | ||
572 | fs_logger_print(); // save the current log | 574 | // save the current log |
575 | fs_logger_print(); | ||
573 | EUID_USER(); | 576 | EUID_USER(); |
574 | 577 | ||
575 | // copy the list of files in the new home directory | 578 | // copy the list of files in the new home directory |