Added check to make sure script is running as root

This commit is contained in:
James Kasten 2012-08-13 04:20:55 -04:00
parent 66660ee0c2
commit f555c8ae93

View file

@ -239,6 +239,11 @@ def authenticate():
TODO: This should be turned into a class...
"""
global server, names, csr, privkey
# Check if root
if not os.geteuid()==0:
sys.exit("\nOnly root can run trustify\n")
if "CHOCOLATESERVER" in os.environ:
server = os.environ["CHOCOLATESERVER"]
if not server: