summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2021-01-28 10:56:18 -0800
committerKarolin Seeger <kseeger@samba.org>2021-02-05 11:15:10 +0000
commita19f94c644d552466fd9f15f1b1d9c04d6fac0e9 (patch)
tree795baae594ce1e6b71a2fb9fa998d637594f5a8b
parent80d2c3e4725689b9bf353c2f2356a451f0ee6711 (diff)
downloadsamba-a19f94c644d552466fd9f15f1b1d9c04d6fac0e9.tar.gz
s3: smbtorture3: Ensure run_tcon_test() always replaces any saved tcon and shuts down correctly even in error paths.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13992 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit f9ca91bd293e9f2710c4449c5d4f5d016a066049)
-rw-r--r--source3/torture/torture.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 56258d3d2ad..03b2340c54f 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -1362,6 +1362,7 @@ static bool run_tcon_test(int dummy)
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_shutdown(cli);
return False;
}
@@ -1414,6 +1415,8 @@ 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_shutdown(cli);
return False;
}
@@ -1422,6 +1425,8 @@ 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_shutdown(cli);
return False;
}