From: Jeremy Allison Date: Wed, 24 Aug 2022 00:37:48 +0000 (-0700) Subject: s3: smbcacls: In cli_lsa_lookup_domain_sid(), replace cli_state_save_tcon()/cli_state... X-Git-Tag: talloc-2.4.0~1032 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e3ea1b2e723f1de3225112311e5fe38fa69683f;p=thirdparty%2Fsamba.git s3: smbcacls: In cli_lsa_lookup_domain_sid(), replace cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share(). There are now no more external users of cli_state_save_tcon()/cli_state_restore_tcon() so we can make them static. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 7ce7d2415dc..d072d396887 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -109,17 +109,14 @@ static NTSTATUS cli_lsa_lookup_domain_sid(struct cli_state *cli, { union lsa_PolicyInformation *info = NULL; struct smbXcli_tcon *orig_tcon = NULL; + char *orig_share = NULL; struct rpc_pipe_client *rpc_pipe = NULL; struct policy_handle handle; NTSTATUS status, result; TALLOC_CTX *frame = talloc_stackframe(); if (cli_state_has_tcon(cli)) { - orig_tcon = cli_state_save_tcon(cli); - if (orig_tcon == NULL) { - status = NT_STATUS_NO_MEMORY; - goto done; - } + cli_state_save_tcon_share(cli, &orig_tcon, &orig_share); } status = cli_tree_connect(cli, "IPC$", "?????", NULL); @@ -153,7 +150,7 @@ tdis: TALLOC_FREE(rpc_pipe); cli_tdis(cli); done: - cli_state_restore_tcon(cli, orig_tcon); + cli_state_restore_tcon_share(cli, orig_tcon, orig_share); TALLOC_FREE(frame); return status; }