s3: torture: Change the SMB1-only UID-REGRESSION-TEST to do an explicit copy of the...
commitb6a9277beaeb7dd113ee6eb95243af8701985216
authorJeremy Allison <jra@samba.org>
Fri, 29 Jan 2021 01:35:55 +0000 (28 17:35 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 3 Feb 2021 21:23:55 +0000 (3 21:23 +0000)
treea74969b24ff0c55e2d4f3c313a013c57c6c3d978
parentb6183a479ca2fdebba123aaa966c2d8041036a62
s3: torture: Change the SMB1-only UID-REGRESSION-TEST to do an explicit copy of the tcon struct in use.

For this test only, explicitly copy the SMB1 tcon struct,
don't use cli_state_save_tcon()//cli_state_restore_tcon()
as these calls will soon change to just manipulate the pointer
to avoid TALLOC_FREE() on the tcon struct which calls
destructors on child pipe data.

In SMB1 this test calls cli_tdis() twice with an invalid
vuid and expects the SMB1 tcon struct to be preserved
across the calls.

SMB1 cli_tdis() frees cli->smb1.tcon so we must put back
a deep copy into cli->smb1.tcon to be able to safely call
cli_tdis() again.

This is a test-only hack. Real client code
uses cli_state_save_tcon()/cli_state_restore_tcon()
if it needs to temporarily swap out the active
tcon on a client connection.

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 e93e6108837eff0cebad8dc26d055c0e1386093a)
source3/torture/torture.c