MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / ensure_superuser

Method ensure_superuser

examples/contrib/mitmproxywrapper.py:121–124  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

119
120 @classmethod
121 def ensure_superuser(cls):
122 if os.getuid() != 0:
123 print("Relaunching with sudo...")
124 os.execv("/usr/bin/sudo", ["/usr/bin/sudo"] + sys.argv)
125
126 @classmethod
127 def main(cls):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected