s3: smbtorture3: Ensure run_tcon_test() always replaces any saved tcon and shuts...
authorJeremy Allison <jra@samba.org>
Thu, 28 Jan 2021 18:56:18 +0000 (10:56 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 3 Feb 2021 21:23:55 +0000 (21:23 +0000)
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)

source3/torture/torture.c

index cdf5d5ca3aa3aed7299de08d751077d06a7630f5..4f572902494d127a36168c1e78c54d056713ff42 100644 (file)
@@ -1347,6 +1347,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;
        }
@@ -1399,6 +1400,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;
        }
 
@@ -1407,6 +1410,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;
        }