summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-02-15 14:03:00 -0500
committerAdam Young <ayoung@redhat.com>2011-02-15 14:21:08 -0500
commitaab27a76e2d847533aab7632c657aa88fdd86f7a (patch)
tree2dc0c93064d0e9fddd3d00ee8411037c51c80659
parentedcdd87bc89dcad82d311dea6e650bff10e04f53 (diff)
downloadfreeipa-aab27a76e2d847533aab7632c657aa88fdd86f7a.tar.gz
freeipa-aab27a76e2d847533aab7632c657aa88fdd86f7a.tar.xz
freeipa-aab27a76e2d847533aab7632c657aa88fdd86f7a.zip
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
-rwxr-xr-xinstall/tools/ipactl3
1 files changed, 3 insertions, 0 deletions
diff --git a/install/tools/ipactl b/install/tools/ipactl
index 6b6db7806..5d8c6dc25 100755
--- a/install/tools/ipactl
+++ b/install/tools/ipactl
@@ -20,6 +20,7 @@
import sys
try:
+ import os
from ipaserver.install import service
from ipaserver.install import dsinstance
from ipapython import config
@@ -226,6 +227,8 @@ def ipa_status():
print "Failed to get %s Service status" % svc
def main():
+ if not os.getegid() == 0:
+ sys.exit("\nYou must be root to run ipactl.\n")
safe_options, options, args = parse_options()