Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyroute2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
safeedge
pyroute2
Commits
628381f4
Commit
628381f4
authored
Apr 22, 2020
by
Peter V. Saveliev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netns: allow to pass libc to NetNS and NSPopen
Bug-Url:
https://github.com/svinota/pyroute2/issues/702
parent
05f00100
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
pyroute2/netns/nslink.py
pyroute2/netns/nslink.py
+2
-2
pyroute2/netns/process/proxy.py
pyroute2/netns/process/proxy.py
+1
-1
No files found.
pyroute2/netns/nslink.py
View file @
628381f4
...
...
@@ -132,7 +132,7 @@ class NetNS(RTNL_API, RemoteSocket):
Do not forget to call `release()` when the work is done. It will shut
down `NetNS` instance as well.
'''
def
__init__
(
self
,
netns
,
flags
=
os
.
O_CREAT
,
target
=
None
):
def
__init__
(
self
,
netns
,
flags
=
os
.
O_CREAT
,
target
=
None
,
libc
=
None
):
self
.
netns
=
netns
self
.
flags
=
flags
target
=
target
or
netns
...
...
@@ -149,7 +149,7 @@ class NetNS(RTNL_API, RemoteSocket):
trnsp_in
.
file_obj
.
close
()
trnsp_out
.
file_obj
.
close
()
try
:
setns
(
self
.
netns
,
self
.
flags
)
setns
(
self
.
netns
,
self
.
flags
,
libc
=
None
)
except
OSError
as
e
:
(
self
.
remote_trnsp_out
...
...
pyroute2/netns/process/proxy.py
View file @
628381f4
...
...
@@ -79,7 +79,7 @@ class NSPopenFile(object):
def
NSPopenServer
(
nsname
,
flags
,
channel_in
,
channel_out
,
argv
,
kwarg
):
# set netns
try
:
setns
(
nsname
,
flags
=
flags
)
setns
(
nsname
,
flags
=
flags
,
libc
=
kwarg
.
pop
(
'libc'
,
None
)
)
except
Exception
as
e
:
channel_out
.
put
(
e
)
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment