mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Don't create log files from help scripts
Helper scripts now use api.bootstrap(log=None) to avoid the creation of log files. Helper scripts are typically executed from daemons which perform their own logging. The helpers still log to stderr/stdout. This also gets rid of some SELinux AVCs when the script tries to write to /root/.ipa/. Fixes: https://pagure.io/freeipa/issue/8075 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
@@ -102,7 +102,7 @@ class IPACustodiaTester:
|
||||
self.args = args
|
||||
if not api.isdone('bootstrap'):
|
||||
# bootstrap to initialize api.env
|
||||
api.bootstrap()
|
||||
api.bootstrap(log=None)
|
||||
self.debug("IPA API bootstrapped")
|
||||
self.realm = api.env.realm
|
||||
self.host = api.env.host
|
||||
|
||||
@@ -186,8 +186,10 @@ class KDCProxyConfig:
|
||||
def main(debug=DEBUG, time_limit=TIME_LIMIT):
|
||||
# initialize API without file logging
|
||||
if not api.isdone('bootstrap'):
|
||||
api.bootstrap(context='server', confdir=paths.ETC_IPA,
|
||||
log=None, debug=debug)
|
||||
api.bootstrap(
|
||||
context='server', confdir=paths.ETC_IPA, log=None,
|
||||
debug=debug
|
||||
)
|
||||
standard_logging_setup(verbose=True, debug=debug)
|
||||
|
||||
try:
|
||||
|
||||
@@ -88,7 +88,7 @@ def main():
|
||||
sys.exit(EXIT_SUCCESS)
|
||||
|
||||
# bootstrap ipalib.api to parse config file
|
||||
api.bootstrap(confdir=paths.ETC_IPA)
|
||||
api.bootstrap(confdir=paths.ETC_IPA, log=None)
|
||||
timeout = api.env.startup_timeout
|
||||
|
||||
conn = get_conn(api.env.host, subsystem=SUBSYSTEM)
|
||||
|
||||
Reference in New Issue
Block a user