bin/xbps-uchroot: mount / as private

This commit is contained in:
Duncaen 2016-09-20 17:45:56 +02:00
parent bc5b38218a
commit 414256292a

View File

@ -364,6 +364,13 @@ main(int argc, char **argv)
SECBIT_NOROOT|SECBIT_NOROOT_LOCKED) == -1) {
die("prctl SECBIT_NOROOT");
}
/* mount as private, systemd mounts it as shared by default */
if (mount(NULL, "/", "none", MS_PRIVATE|MS_REC, NULL) == -1)
die("Failed to mount / private");
if (mount(NULL, "/", "none", MS_PRIVATE|MS_REMOUNT|MS_NOSUID, NULL) == -1)
die("Failed to remount /");
/* setup our overlayfs if set */
if (overlayfs)
chrootdir = setup_overlayfs(chrootdir, ruid, rgid,