From e96d0776f8fd7703a4ca6794f6766fa8577db6f5 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Mon, 21 Mar 2011 17:18:30 +0100 Subject: Running ipa-replica-manage as non-root cause errors Logging errors are printed out when ipa-replica-manage is run as a non-root user. Log has been disabled in such case to prevent such messages. https://fedorahosted.org/freeipa/ticket/1046 --- install/tools/ipa-replica-manage | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'install') diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage index 87c994aa5..1adf0cebb 100755 --- a/install/tools/ipa-replica-manage +++ b/install/tools/ipa-replica-manage @@ -18,6 +18,7 @@ # along with this program. If not, see . # import sys +import os import getpass, ldap, re, krbV import traceback, logging @@ -415,7 +416,13 @@ def main(): # Just initialize the environment. This is so the installer can have # access to the plugin environment - api.bootstrap(in_server=True) + api_env = {} + api_env['in_server'] = True + + if os.getegid() != 0: + api_env['log'] = None # turn off logging for non-root + + api.bootstrap(**api_env) api.finalize() dirman_passwd = None -- cgit