fixed /sys mounting broken during overlayfs cleanup

This commit is contained in:
netblue30 2025-12-18 11:46:14 -05:00
parent 890b578bfd
commit b537aa57b9

View file

@ -728,6 +728,8 @@ 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 && !cfg.chrootdir)
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