ostbuild: Ensure user chroot mounts are not shared
It's possible that the root filesystem mount is global; we need to undo that in order to be sure that our "private" bind mounts really are private.
This commit is contained in:
parent
e68d0d25c0
commit
0fb40b201f
|
|
@ -98,6 +98,9 @@ main (int argc,
|
||||||
if (unshare (CLONE_NEWNS) < 0)
|
if (unshare (CLONE_NEWNS) < 0)
|
||||||
fatal_errno ("unshare (CLONE_NEWNS)");
|
fatal_errno ("unshare (CLONE_NEWNS)");
|
||||||
|
|
||||||
|
if (mount ("/", "/", "none", MS_PRIVATE, NULL) < 0)
|
||||||
|
fatal_errno ("mount(/, MS_PRIVATE)");
|
||||||
|
|
||||||
initialize_chroot (chroot_dir);
|
initialize_chroot (chroot_dir);
|
||||||
|
|
||||||
if (chroot (chroot_dir) < 0)
|
if (chroot (chroot_dir) < 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue