From 82f327fce897f452e269d22a8ed348bb5cddfa0b Mon Sep 17 00:00:00 2001 From: Gary Lockyer Date: Thu, 6 Jun 2019 11:40:08 +1200 Subject: [PATCH] kcc: default to logging to DBGLVL_WARNING If the "-d" debug level parameter is not supplied, default to DBGLVL_WARNING. Overiding the "log level" set in smb.conf. When samba runs the kcc command stderr output is logged at DBGLVL_ERR, the default log destination is stderr. As a result any log messages generated by the kcc command, are effectively logged at DBGLVL_ERR. This causes issues if auth or audit logging are enabled in smb.conf. Signed-off-by: Gary Lockyer Reviewed-by: Andrew Bartlett Pair-programmed-with: Tim Beale Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Tue Jul 2 05:49:43 UTC 2019 on sn-devel-184 --- source4/scripting/bin/samba_kcc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source4/scripting/bin/samba_kcc b/source4/scripting/bin/samba_kcc index aded135907b..122a5ed2c5e 100755 --- a/source4/scripting/bin/samba_kcc +++ b/source4/scripting/bin/samba_kcc @@ -250,7 +250,6 @@ parser.add_option("--forget-intersite-links", default=False, help="pretend not to know the existing intersite topology", action="store_true") - opts, args = parser.parse_args() @@ -286,6 +285,10 @@ else: unix_now = int(time.time()) lp = sambaopts.get_loadparm() +# only log warnings/errors by default, unless the user has specified otherwise +if opts.debug is None: + lp.set('log level', '1') + creds = credopts.get_credentials(lp, fallback_machine=True) if opts.dburl is None: -- 2.47.3