All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pablo M. Bermudo Garay" <pablombg@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: "Pablo M. Bermudo Garay" <pablombg@gmail.com>
Subject: [PATCH iptables 2/2] tests: xlate: check if it is being run as root
Date: Wed, 19 Apr 2017 01:19:09 +0200	[thread overview]
Message-ID: <1492557549-578-2-git-send-email-pablombg@gmail.com> (raw)
In-Reply-To: <1492557549-578-1-git-send-email-pablombg@gmail.com>

Signed-off-by: Pablo M. Bermudo Garay <pablombg@gmail.com>
---
 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


  reply	other threads:[~2017-04-19 16:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 23:19 [PATCH iptables 1/2] tests: xlate: remove python 3.5 dependency Pablo M. Bermudo Garay
2017-04-18 23:19 ` Pablo M. Bermudo Garay [this message]
2017-04-25  9:00   ` [PATCH iptables 2/2] tests: xlate: check if it is being run as root Pablo Neira Ayuso
2017-04-25  9:00 ` [PATCH iptables 1/2] tests: xlate: remove python 3.5 dependency Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1492557549-578-2-git-send-email-pablombg@gmail.com \
    --to=pablombg@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.