Created
January 22, 2018 16:35
-
-
Save itdaniher/5308c0905ed76189381861964ac974aa to your computer and use it in GitHub Desktop.
setns leaks FDs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import traceback | |
import pyroute2.netns | |
i = 0 | |
while True: | |
try: | |
pyroute2.netns.setns('/proc/1/ns/net') | |
except: | |
traceback.print_exc(file=sys.stderr) | |
print(i) | |
break | |
i += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment