Require ipactl be run as root to avoid a lot of misleading error msgs.

Trying to run ipactl as non-root results in a slew of bogus
error messages, some of which come because dirsrv can't read certain
files as the wrong user, some based on our handling of that fact.

ticket 936
This commit is contained in:
Rob Crittenden 2011-02-15 14:03:00 -05:00 committed by Adam Young
parent edcdd87bc8
commit aab27a76e2

View File

@ -20,6 +20,7 @@
import sys import sys
try: try:
import os
from ipaserver.install import service from ipaserver.install import service
from ipaserver.install import dsinstance from ipaserver.install import dsinstance
from ipapython import config from ipapython import config
@ -226,6 +227,8 @@ def ipa_status():
print "Failed to get %s Service status" % svc print "Failed to get %s Service status" % svc
def main(): def main():
if not os.getegid() == 0:
sys.exit("\nYou must be root to run ipactl.\n")
safe_options, options, args = parse_options() safe_options, options, args = parse_options()