]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpcclient: Use lpcfg_set_cmdline()
authorPavel Kalugin <pkalugin@inno.tech>
Sun, 6 Aug 2023 19:19:26 +0000 (22:19 +0300)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 23 Aug 2023 08:27:30 +0000 (08:27 +0000)
Signed-off-by: Pavel Kalugin <pkalugin@inno.tech>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/rpcclient/rpcclient.c

index 27fe5d705c657c1e40b93e1373f46448bfd25da3..f59bf6b0c982a5b77c798f2df63a23a7f46fd67c 100644 (file)
@@ -37,6 +37,7 @@
 #include "cmdline_contexts.h"
 #include "../librpc/gen_ndr/ndr_samr.h"
 #include "lib/cmdline/cmdline.h"
+#include "lib/param/param.h"
 
 enum pipe_auth_type_spnego {
        PIPE_AUTH_TYPE_SPNEGO_NONE = 0,
@@ -331,7 +332,8 @@ static NTSTATUS cmd_debuglevel(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
        }
 
        if (argc == 2) {
-               lp_set_cmdline("log level", argv[1]);
+               struct loadparm_context *lp_ctx = samba_cmdline_get_lp_ctx();
+               lpcfg_set_cmdline(lp_ctx, "log level", argv[1]);
        }
 
        printf("debuglevel is %d\n", DEBUGLEVEL);
@@ -1164,6 +1166,7 @@ out_free:
        const char *binding_string = NULL;
        const char *host;
        struct cli_credentials *creds = NULL;
+       struct loadparm_context *lp_ctx = NULL;
        bool ok;
 
        /* make sure the vars that get altered (4th field) are in
@@ -1194,7 +1197,8 @@ out_free:
        if (!ok) {
                DBG_ERR("Failed to init cmdline parser!\n");
        }
-       lp_set_cmdline("log level", "0");
+       lp_ctx = samba_cmdline_get_lp_ctx();
+       lpcfg_set_cmdline(lp_ctx, "log level", "0");
 
        /* Parse options */
        pc = samba_popt_get_context(getprogname(),