[PATCH iptables 2/2] tests: xlate: check if it is being run as root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pablo M. Bermudo Garay <pablombg@xxxxxxxxx>
---
 xlate-test.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xlate-test.py b/xlate-test.py
index 37760e9..43c4be1 100755
--- a/xlate-test.py
+++ b/xlate-test.py
@@ -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:
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux