]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
Remount / recursive ms-slave in our new mntns
authorStéphane Graber <stgraber@ubuntu.com>
Fri, 23 Jan 2015 18:44:38 +0000 (13:44 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 23 Jan 2015 18:44:38 +0000 (13:44 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
lxcfs.c

diff --git a/lxcfs.c b/lxcfs.c
index 39238822c0dd3272ced2b9d69c17c576be7c34f3..d6fb101b8a33bec4642c20db2baf7927a21f3f2a 100644 (file)
--- a/lxcfs.c
+++ b/lxcfs.c
@@ -1717,6 +1717,11 @@ static long int get_pid1_time(pid_t pid)
        if (unshare(CLONE_NEWNS))
                return 0;
 
+       if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL)) {
+               perror("rslave mount failed");
+               return 0;
+       }
+
        sprintf(fnam, "/proc/%d/ns/pid", pid);
        fd = open(fnam, O_RDONLY);
        if (fd < 0) {