]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
tests: xlate: check if it is being run as root
authorPablo M. Bermudo Garay <pablombg@gmail.com>
Tue, 18 Apr 2017 23:19:09 +0000 (01:19 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 25 Apr 2017 08:55:27 +0000 (10:55 +0200)
Signed-off-by: Pablo M. Bermudo Garay <pablombg@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
xlate-test.py

index 37760e961b83d22d1aa5e299dcfe428a7d95fc2c..43c4be190a3f81a860f324574dbbf2f823df186d 100755 (executable)
@@ -72,7 +72,9 @@ def load_test_files():
 
 
 def main():
-    if args.test:
+    if os.getuid() != 0:
+        print(red("Error: ") + "You need to be root to run this, sorry")
+    elif args.test:
         if not args.test.endswith(".txlate"):
             args.test += ".txlate"
         try: