summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2022-08-23 17:32:46 -0700
committerJeremy Allison <jra@samba.org>2022-09-15 18:43:32 +0000
commitd116a079e99227140292d020318d381985c350b0 (patch)
tree06d0a7061d273dea074cacc4aa052fc02120ed8e
parentcf02ed2f6054325dfbcf3d98ba1b9f5d454b100e (diff)
downloadsamba-d116a079e99227140292d020318d381985c350b0.tar.gz
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>
-rw-r--r--source3/torture/torture.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 2bd15fcec00..ee50fd8ee09 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -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) {