From: Jeremy Allison Date: Wed, 24 Aug 2022 00:34:43 +0000 (-0700) Subject: s3: utils: In show_userlist() replace cli_state_save_tcon()/cli_state_restore_tcon... X-Git-Tag: talloc-2.4.0~1033 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fddade459f2512709cf0e2e4b9b45de540f4e29f;p=thirdparty%2Fsamba.git s3: utils: In show_userlist() replace cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share(). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 97c0158d612..1c89ffcd5e5 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -5129,6 +5129,7 @@ static void show_userlist(struct rpc_pipe_client *pipe_hnd, WERROR result; NTSTATUS status; struct smbXcli_tcon *orig_tcon = NULL; + char *orig_share = NULL; struct dcerpc_binding_handle *b = pipe_hnd->binding_handle; status = dcerpc_srvsvc_NetShareGetInfo(b, mem_ctx, @@ -5151,14 +5152,11 @@ static void show_userlist(struct rpc_pipe_client *pipe_hnd, } if (cli_state_has_tcon(cli)) { - orig_tcon = cli_state_save_tcon(cli); - if (orig_tcon == NULL) { - return; - } + cli_state_save_tcon_share(cli, &orig_tcon, &orig_share); } if (!NT_STATUS_IS_OK(cli_tree_connect(cli, netname, "A:", NULL))) { - cli_state_restore_tcon(cli, orig_tcon); + cli_state_restore_tcon_share(cli, orig_tcon, orig_share); return; } @@ -5201,7 +5199,7 @@ static void show_userlist(struct rpc_pipe_client *pipe_hnd, if (fnum != (uint16_t)-1) cli_close(cli, fnum); cli_tdis(cli); - cli_state_restore_tcon(cli, orig_tcon); + cli_state_restore_tcon_share(cli, orig_tcon, orig_share); return; }