summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authortopimiettinen <topimiettinen@users.noreply.github.com>2016-05-14 16:46:23 +0000
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-05-14 12:46:23 -0400
commit9e5f825280192be429cc79153235d12778427fae (patch)
tree065778dfc34e81db15f80c97edda08485b6b84c3 /src/core
parent2099b3e9931eea8962cf7a97493abf9361cc6366 (diff)
namespace: unmount old /dev under our new private /dev (#3254)
Drop all dangling old /dev mounts before mounting a new private /dev tree.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/namespace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/namespace.c b/src/core/namespace.c
index b573f008b9..ef85bfec23 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -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;