aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2018-08-29 01:42:45 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2018-08-29 01:42:45 +0200
commit88c4986c5d907c600c2df2ee96e4bb2aa3cdc631 (patch)
tree70bd49b5a0b4896c34a4b64b3b087439b726b8fc
parentcleanup (diff)
downloadfirejail-88c4986c5d907c600c2df2ee96e4bb2aa3cdc631.tar.gz
firejail-88c4986c5d907c600c2df2ee96e4bb2aa3cdc631.tar.zst
firejail-88c4986c5d907c600c2df2ee96e4bb2aa3cdc631.zip
silence warning about failed unmounting of /sys (overlay options)
-rw-r--r--src/firejail/fs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/firejail/fs.c b/src/firejail/fs.c
index 98efb5e41..08b268d93 100644
--- a/src/firejail/fs.c
+++ b/src/firejail/fs.c
@@ -571,8 +571,11 @@ void fs_proc_sys_dev_boot(void) {
571 /* Mount a version of /sys that describes the network namespace */ 571 /* Mount a version of /sys that describes the network namespace */
572 if (arg_debug) 572 if (arg_debug)
573 printf("Remounting /sys directory\n"); 573 printf("Remounting /sys directory\n");
574 if (umount2("/sys", MNT_DETACH) < 0) 574 // if this is an overlay, just mount a new /sys on top of the upper layer
575 fwarning("failed to unmount /sys\n"); 575 if (!arg_overlay) {
576 if (umount2("/sys", MNT_DETACH) < 0)
577 fwarning("failed to unmount /sys\n");
578 }
576 if (mount("sysfs", "/sys", "sysfs", MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REC, NULL) < 0) 579 if (mount("sysfs", "/sys", "sysfs", MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REC, NULL) < 0)
577 fwarning("failed to mount /sys\n"); 580 fwarning("failed to mount /sys\n");
578 else 581 else