From c295b2dd01f8b2a2c754da59e6ff3bcc2a6c14c9 Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Mon, 1 Jul 2013 18:01:32 -0400 Subject: [PATCH] Fixed pid ns bug --- lxcsu-internal | 6 ++++-- setns.c | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lxcsu-internal b/lxcsu-internal index a670d62..bb7c2a4 100755 --- a/lxcsu-internal +++ b/lxcsu-internal @@ -142,6 +142,9 @@ def main (): setns.chcontext('/proc/%s/ns/uts'%pid) setns.chcontext('/proc/%s/ns/ipc'%pid) + + if (not args.pidns): + setns.chcontext('/proc/%s/ns/pid'%pid) if (not args.netns): setns.chcontext('/proc/%s/ns/net'%pid) @@ -149,8 +152,7 @@ def main (): if (not args.mntns): setns.chcontext('/proc/%s/ns/mnt'%pid) - if (not args.pidns): - setns.chcontext('/proc/%s/ns/pid'%pid) + proc_mounted = False if (not os.access('/proc/self',0)): diff --git a/setns.c b/setns.c index 7d82d53..971665a 100644 --- a/setns.c +++ b/setns.c @@ -15,12 +15,11 @@ chfscontext(PyObject *self, PyObject *args) int fd = open(filepath, O_RDONLY); if (fd < 0) { - //printf("Could not open ns file\n"); sts = -1; goto out; } - if (setns(fd, 666)) { + if (setns(fd, 0)) { sts = -1; } close(fd); @@ -59,7 +58,6 @@ chcontext(PyObject *self, PyObject *args) int fd = open(filepath, O_RDONLY); if (fd < 0) { -// printf("Could not open ns file\n"); sts = -1; goto out; } -- 2.43.0