Skip to content

Commit

Permalink
silence warning about failed unmounting of /sys (overlay options)
Browse files Browse the repository at this point in the history
  • Loading branch information
smitsohu committed Aug 28, 2018
1 parent 7c0cf39 commit 88c4986
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/firejail/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,11 @@ void fs_proc_sys_dev_boot(void) {
/* Mount a version of /sys that describes the network namespace */
if (arg_debug)
printf("Remounting /sys directory\n");
if (umount2("/sys", MNT_DETACH) < 0)
fwarning("failed to unmount /sys\n");
// if this is an overlay, just mount a new /sys on top of the upper layer
if (!arg_overlay) {
if (umount2("/sys", MNT_DETACH) < 0)
fwarning("failed to unmount /sys\n");
}
if (mount("sysfs", "/sys", "sysfs", MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REC, NULL) < 0)
fwarning("failed to mount /sys\n");
else
Expand Down

0 comments on commit 88c4986

Please sign in to comment.