]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
namespace: unmount old /dev under our new private /dev (#3254)
authortopimiettinen <topimiettinen@users.noreply.github.com>
Sat, 14 May 2016 16:46:23 +0000 (16:46 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 14 May 2016 16:46:23 +0000 (12:46 -0400)
Drop all dangling old /dev mounts before mounting a new private /dev tree.

src/core/namespace.c

index b573f008b9124e397102a25ab3400e2da7e5e66d..ef85bfec237887239c32c324aa9532b71502e008 100644 (file)
@@ -237,6 +237,8 @@ static int mount_dev(BindMount *m) {
          */
         (void) mkdir_p_label(m->path, 0755);
 
+        /* Unmount everything in old /dev */
+        umount_recursive(m->path, 0);
         if (mount(dev, m->path, NULL, MS_MOVE, NULL) < 0) {
                 r = -errno;
                 goto fail;