From: Andreas Schneider Date: Wed, 6 Dec 2023 07:48:34 +0000 (+0100) Subject: s3:utils: Fix setting the debug level X-Git-Tag: talloc-2.4.2~426 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=763b2efe69dc74e1c0cd954607031012f832486d;p=thirdparty%2Fsamba.git s3:utils: Fix setting the debug level BUG: https://bugzilla.samba.org/show_bug.cgi?id=15525 Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Dec 7 05:33:21 UTC 2023 on atb-devel-224 --- diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c index a43679328c1..dc8dace8a55 100644 --- a/source3/utils/smbget.c +++ b/source3/utils/smbget.c @@ -849,6 +849,7 @@ int main(int argc, char **argv) uint32_t gensec_features; bool use_wbccache = false; SMBCCTX *smb_ctx = NULL; + int dbg_lvl = -1; int rc; smb_init_locale(); @@ -922,13 +923,16 @@ int main(int argc, char **argv) samba_cmdline_burn(argc, argv); + /* smbc_new_context() will set the log level to 0 */ + dbg_lvl = debuglevel_get(); + smb_ctx = smbc_new_context(); if (smb_ctx == NULL) { fprintf(stderr, "Unable to initialize libsmbclient\n"); ok = false; goto done; } - smbc_setDebug(smb_ctx, debuglevel_get()); + smbc_setDebug(smb_ctx, dbg_lvl); rc = smbc_setConfiguration(smb_ctx, lp_default_path()); if (rc < 0) {