diff options
Diffstat (limited to 'src/namespace.c')
-rw-r--r-- | src/namespace.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/namespace.c b/src/namespace.c index 54b22f494e..a06cac10fd 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -266,8 +266,12 @@ int setup_namespace( goto fail; } - /* We assume that by default mount events from us won't be - * propagated to the root namespace. */ + /* Remount / as SLAVE so that nothing mounted in the namespace + shows up in the parent */ + if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL) < 0) { + r = -errno; + goto fail; + } for (p = paths; p < paths + n; p++) if ((r = apply_mount(p, root_dir, inaccessible_dir, private_dir, flags)) < 0) |