From: Karim Hamidou Date: Wed, 19 Oct 2016 04:35:54 +0000 (-0700) Subject: Raise an error if not root. X-Git-Tag: 1.0.0~6 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=fc9c144ce9265a1e993153e423b047dea28ab904;p=lptrace.git Raise an error if not root. --- diff --git a/lptrace.py b/lptrace.py index 667f7f7..207499c 100644 --- a/lptrace.py +++ b/lptrace.py @@ -97,6 +97,10 @@ def main(): pid = int(options.pid) + if os.geteuid() != 0: + print "Error: you must be root to run lptrace. Exiting." + sys.exit(-1) + if options.debugger is True: pdb_prompt(pid) else: