From 6f00a088266d71f1ee94ee3c78ca695edc457467 Mon Sep 17 00:00:00 2001 From: Pavel Kalugin Date: Mon, 14 Aug 2023 06:01:28 +0300 Subject: [PATCH] s3:torture: Use lpcfg_set_cmdline() Signed-off-by: Pavel Kalugin Reviewed-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- source3/torture/torture.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source3/torture/torture.c b/source3/torture/torture.c index bfce1c9dcd6..486fb4c8115 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -16233,6 +16233,7 @@ static void usage(void) bool correct = True; TALLOC_CTX *frame = talloc_stackframe(); int seed = time(NULL); + struct loadparm_context *lp_ctx = NULL; #ifdef HAVE_SETBUFFER setbuffer(stdout, NULL, 0); @@ -16243,6 +16244,13 @@ static void usage(void) smb_init_locale(); fault_setup(); + lp_ctx = loadparm_init_s3(frame, loadparm_s3_helpers()); + if (lp_ctx == NULL) { + fprintf(stderr, + "Failed to initialise the global parameter structure.\n"); + return 1; + } + if (is_default_dyn_CONFIGFILE()) { if(getenv("SMB_CONF_PATH")) { set_dyn_CONFIGFILE(getenv("SMB_CONF_PATH")); @@ -16299,7 +16307,7 @@ static void usage(void) fstrcpy(workgroup,optarg); break; case 'm': - lp_set_cmdline("client max protocol", optarg); + lpcfg_set_cmdline(lp_ctx, "client max protocol", optarg); break; case 'N': torture_nprocs = atoi(optarg); @@ -16308,7 +16316,7 @@ static void usage(void) torture_numops = atoi(optarg); break; case 'd': - lp_set_cmdline("log level", optarg); + lpcfg_set_cmdline(lp_ctx, "log level", optarg); break; case 'O': sockops = optarg; -- 2.47.3