1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

s3: torture: In run_tcon_test() replace cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share().

Also fix a comment in run_uid_regression_test().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
Jeremy Allison 2022-08-23 17:32:46 -07:00
parent cf02ed2f60
commit d116a079e9

View File

@ -1435,6 +1435,7 @@ static bool run_tcon_test(int dummy)
uint16_t fnum1;
uint32_t cnum1, cnum2, cnum3;
struct smbXcli_tcon *orig_tcon = NULL;
char *orig_share = NULL;
uint16_t vuid1, vuid2;
char buf[4];
bool ret = True;
@ -1466,16 +1467,13 @@ static bool run_tcon_test(int dummy)
return False;
}
orig_tcon = cli_state_save_tcon(cli);
if (orig_tcon == NULL) {
return false;
}
cli_state_save_tcon_share(cli, &orig_tcon, &orig_share);
status = cli_tree_connect_creds(cli, share, "?????", torture_creds);
if (!NT_STATUS_IS_OK(status)) {
printf("%s refused 2nd tree connect (%s)\n", host,
nt_errstr(status));
cli_state_restore_tcon(cli, orig_tcon);
cli_state_restore_tcon_share(cli, orig_tcon, orig_share);
cli_shutdown(cli);
return False;
}
@ -1528,7 +1526,7 @@ static bool run_tcon_test(int dummy)
status = cli_close(cli, fnum1);
if (!NT_STATUS_IS_OK(status)) {
printf("close failed (%s)\n", nt_errstr(status));
cli_state_restore_tcon(cli, orig_tcon);
cli_state_restore_tcon_share(cli, orig_tcon, orig_share);
cli_shutdown(cli);
return False;
}
@ -1538,12 +1536,12 @@ static bool run_tcon_test(int dummy)
status = cli_tdis(cli);
if (!NT_STATUS_IS_OK(status)) {
printf("secondary tdis failed (%s)\n", nt_errstr(status));
cli_state_restore_tcon(cli, orig_tcon);
cli_state_restore_tcon_share(cli, orig_tcon, orig_share);
cli_shutdown(cli);
return False;
}
cli_state_restore_tcon(cli, orig_tcon);
cli_state_restore_tcon_share(cli, orig_tcon, orig_share);
cli_state_set_tid(cli, cnum1);
@ -11856,7 +11854,7 @@ static bool run_uid_regression_test(int dummy)
* second tdis call with invalid vuid.
*
* This is a test-only hack. Real client code
* uses cli_state_save_tcon()/cli_state_restore_tcon().
* uses cli_state_save_tcon_share()/cli_state_restore_tcon_share().
*/
tcon_copy = smbXcli_tcon_copy(cli, cli->smb1.tcon);
if (tcon_copy == NULL) {