]> khamidou — GitHub mirrors - lptrace.git/commitdiff
Raise an error if not root.
authorKarim Hamidou <khamidou@gmail.com>
Wed, 19 Oct 2016 04:35:54 +0000 (21:35 -0700)
committerKarim Hamidou <khamidou@gmail.com>
Wed, 19 Oct 2016 04:35:54 +0000 (21:35 -0700)
lptrace.py

index 667f7f72ccbc0e026a0810dc3eb90014060ad67f..207499cf7cc318524326eef46ea2ee4065900b5a 100644 (file)
@@ -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: