>From a216398936a60a34c534e9cb80e97c8bbc9126b1 Mon Sep 17 00:00:00 2001 From: Gowrishankar Rajaiyan Date: Mon, 31 Jan 2011 19:07:06 +0530 Subject: [PATCH] Fixed traceback messages while executing as non-root --- src/tools/sss_obfuscate | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/src/tools/sss_obfuscate b/src/tools/sss_obfuscate index cd91161515b1db62dba3b3f7f0b4db88970a07e0..c2df0a75f294b15d7f03a9d571401583657185bc 100644 --- a/src/tools/sss_obfuscate +++ b/src/tools/sss_obfuscate @@ -1,5 +1,6 @@ #!/usr/bin/python +import os import sys from optparse import OptionParser @@ -40,6 +41,10 @@ def main(): print >> sys.stderr, "Cannot parse options" return 1 + if not os.geteuid() == 0: + print "sss_obfuscate must be run as root" + return 1 + if not options.stdin and not options.password: pprompt = lambda: (getpass.getpass("Enter password: "), getpass.getpass("Re-enter password: ")) p1, p2 = pprompt() -- 1.7.2.3