git://git.onelab.eu
/
lxc-userspace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e2b59d8
)
Fixed pid ns bug
author
Sapan Bhatia
<gwsapan@gmail.com>
Mon, 1 Jul 2013 22:01:32 +0000
(18:01 -0400)
committer
Sapan Bhatia
<gwsapan@gmail.com>
Mon, 1 Jul 2013 22:01:32 +0000
(18:01 -0400)
lxcsu-internal
patch
|
blob
|
history
setns.c
patch
|
blob
|
history
diff --git
a/lxcsu-internal
b/lxcsu-internal
index
a670d62
..
bb7c2a4
100755
(executable)
--- 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)
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)
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.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)):
proc_mounted = False
if (not os.access('/proc/self',0)):
diff --git
a/setns.c
b/setns.c
index
7d82d53
..
971665a
100644
(file)
--- a/
setns.c
+++ b/
setns.c
@@
-15,12
+15,11
@@
chfscontext(PyObject *self, PyObject *args)
int fd = open(filepath, O_RDONLY);
if (fd < 0) {
int fd = open(filepath, O_RDONLY);
if (fd < 0) {
- //printf("Could not open ns file\n");
sts = -1;
goto out;
}
sts = -1;
goto out;
}
- if (setns(fd,
666
)) {
+ if (setns(fd,
0
)) {
sts = -1;
}
close(fd);
sts = -1;
}
close(fd);
@@
-59,7
+58,6
@@
chcontext(PyObject *self, PyObject *args)
int fd = open(filepath, O_RDONLY);
if (fd < 0) {
int fd = open(filepath, O_RDONLY);
if (fd < 0) {
-// printf("Could not open ns file\n");
sts = -1;
goto out;
}
sts = -1;
goto out;
}