]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
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>
Fri, 5 Feb 2021 11:15:10 +0000 (11:15 +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 56258d3d2ad50ea0d75281190256407444f84046..03b2340c54ff992727f4f8c1acd227122ab8abca 100644 (file)
@@ -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;
        }