From: Jeremy Allison Date: Wed, 24 Aug 2022 00:28:21 +0000 (-0700) Subject: s3: libsmb: In cli_check_msdfs_proxy() replace cli_state_save_tcon()/cli_state_restor... X-Git-Tag: talloc-2.4.0~1036 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcf090279e29ce72a6aee2b6059b168f7a479d91;p=thirdparty%2Fsamba.git s3: libsmb: In cli_check_msdfs_proxy() 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/libsmb/clidfs.c b/source3/libsmb/clidfs.c index 4fa1fc4aa45..d8355f8058b 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -1156,6 +1156,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx, char *fullpath = NULL; bool res; struct smbXcli_tcon *orig_tcon = NULL; + char *orig_share = NULL; char *newextrapath = NULL; NTSTATUS status; const char *remote_name; @@ -1183,16 +1184,13 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx, /* Store tcon state. */ if (cli_state_has_tcon(cli)) { - orig_tcon = cli_state_save_tcon(cli); - if (orig_tcon == NULL) { - return false; - } + cli_state_save_tcon_share(cli, &orig_tcon, &orig_share); } /* check for the referral */ if (!NT_STATUS_IS_OK(cli_tree_connect(cli, "IPC$", "IPC", NULL))) { - cli_state_restore_tcon(cli, orig_tcon); + cli_state_restore_tcon_share(cli, orig_tcon, orig_share); return false; } @@ -1211,7 +1209,9 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx, * tcon so we don't leak it. */ cli_tdis(cli); - cli_state_restore_tcon(cli, orig_tcon); + cli_state_restore_tcon_share(cli, + orig_tcon, + orig_share); return false; } } @@ -1223,7 +1223,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx, status = cli_tdis(cli); - cli_state_restore_tcon(cli, orig_tcon); + cli_state_restore_tcon_share(cli, orig_tcon, orig_share); if (!NT_STATUS_IS_OK(status)) { return false;