aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/fs_home.c
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2021-10-09 13:16:31 +0000
committerLibravatar GitHub <noreply@github.com>2021-10-09 13:16:31 +0000
commit44c15b67d48f2e5d2deff3f88cbf1129979065f7 (patch)
tree093e526ad450867c3cdf0b19a48a35553a91d342 /src/firejail/fs_home.c
parentfirejail.h: add missing linux/limits.h include (diff)
parentMerge pull request #4579 from dm9pZCAq/master (diff)
downloadfirejail-44c15b67d48f2e5d2deff3f88cbf1129979065f7.tar.gz
firejail-44c15b67d48f2e5d2deff3f88cbf1129979065f7.tar.zst
firejail-44c15b67d48f2e5d2deff3f88cbf1129979065f7.zip
Merge branch 'master' into fix-include-limits-h
Diffstat (limited to 'src/firejail/fs_home.c')
-rw-r--r--src/firejail/fs_home.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/firejail/fs_home.c b/src/firejail/fs_home.c
index 45889b27f..8d8530d81 100644
--- a/src/firejail/fs_home.c
+++ b/src/firejail/fs_home.c
@@ -394,14 +394,16 @@ void fs_private(void) {
394 } 394 }
395 if (chown(homedir, u, g) < 0) 395 if (chown(homedir, u, g) < 0)
396 errExit("chown"); 396 errExit("chown");
397
398 fs_logger2("mkdir", homedir); 397 fs_logger2("mkdir", homedir);
399 fs_logger2("tmpfs", homedir); 398 fs_logger2("tmpfs", homedir);
400 } 399 }
401 else 400 else {
402 // mask user home directory 401 // mask user home directory
403 // the directory should be owned by the current user 402 // the directory should be owned by the current user
403 EUID_USER();
404 fs_tmpfs(homedir, 1); 404 fs_tmpfs(homedir, 1);
405 EUID_ROOT();
406 }
405 407
406 selinux_relabel_path(homedir, homedir); 408 selinux_relabel_path(homedir, homedir);
407 } 409 }
@@ -563,12 +565,13 @@ void fs_private_home_list(void) {
563 int xflag = store_xauthority(); 565 int xflag = store_xauthority();
564 int aflag = store_asoundrc(); 566 int aflag = store_asoundrc();
565 567
566 // create /run/firejail/mnt/home directory
567 EUID_ROOT(); 568 EUID_ROOT();
569 // create /run/firejail/mnt/home directory
568 mkdir_attr(RUN_HOME_DIR, 0755, uid, gid); 570 mkdir_attr(RUN_HOME_DIR, 0755, uid, gid);
569 selinux_relabel_path(RUN_HOME_DIR, homedir); 571 selinux_relabel_path(RUN_HOME_DIR, homedir);
570 572
571 fs_logger_print(); // save the current log 573 // save the current log
574 fs_logger_print();
572 EUID_USER(); 575 EUID_USER();
573 576
574 // copy the list of files in the new home directory 577 // copy the list of files in the new home directory