From: Jeremy Allison Date: Wed, 24 Aug 2022 00:18:16 +0000 (-0700) Subject: s3: libsmb: In cli_lsa_lookup_sid() replace cli_state_save_tcon()/cli_state_restore_t... X-Git-Tag: talloc-2.4.0~1038 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73fde1fbbf0fe569c49bfdcd49bc5efe31c7d891;p=thirdparty%2Fsamba.git s3: libsmb: In cli_lsa_lookup_sid() 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/lib/util_sd.c b/source3/lib/util_sd.c index 2141eaf49ac..7439e261be1 100644 --- a/source3/lib/util_sd.c +++ b/source3/lib/util_sd.c @@ -87,6 +87,7 @@ static NTSTATUS cli_lsa_lookup_sid(struct cli_state *cli, char **domain, char **name) { struct smbXcli_tcon *orig_tcon = NULL; + char *orig_share = NULL; struct rpc_pipe_client *p = NULL; struct policy_handle handle; NTSTATUS status; @@ -96,11 +97,7 @@ static NTSTATUS cli_lsa_lookup_sid(struct cli_state *cli, char **names; if (cli_state_has_tcon(cli)) { - orig_tcon = cli_state_save_tcon(cli); - if (orig_tcon == NULL) { - status = NT_STATUS_NO_MEMORY; - goto tcon_fail; - } + cli_state_save_tcon_share(cli, &orig_tcon, &orig_share); } status = cli_tree_connect(cli, "IPC$", "?????", NULL); @@ -135,7 +132,7 @@ static NTSTATUS cli_lsa_lookup_sid(struct cli_state *cli, TALLOC_FREE(p); cli_tdis(cli); tcon_fail: - cli_state_restore_tcon(cli, orig_tcon); + cli_state_restore_tcon_share(cli, orig_tcon, orig_share); TALLOC_FREE(frame); return status; }