From: Gary Lockyer Date: Wed, 5 Jun 2019 23:40:08 +0000 (+1200) Subject: kcc: default to logging to DBGLVL_WARNING X-Git-Tag: ldb-2.0.5~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=82f327fce897f452e269d22a8ed348bb5cddfa0b;p=thirdparty%2Fsamba.git 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 --- 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: