return false;
}
+static void test_multichannel_init_smb_create(struct smb2_create *io)
+{
+ io->in.durable_open = false;
+ io->in.durable_open_v2 = true;
+ io->in.persistent_open = false;
+ io->in.create_guid = GUID_random();
+ io->in.timeout = 0x493E0; /* 300000 */
+ /* windows 2016 returns 300000 0x493E0 */
+}
+
/**
* Test Oplock Break with Multi Channel
*/
struct smb2_handle h_client2_file2 = { 0 };
struct smb2_handle h_client2_file3 = { 0 };
struct smb2_create io1, io2, io3;
- struct GUID create_guid1 = GUID_random();
- struct GUID create_guid2 = GUID_random();
- struct GUID create_guid3 = GUID_random();
bool ret = true;
int rval;
const char *fname1 = BASEDIR "\\oplock_break_test1.dat";
smb2_oplock_create_share(&io1, fname1,
smb2_util_share_access("RWD"),
smb2_util_oplock_level("b"));
- io1.in.durable_open = false;
- io1.in.durable_open_v2 = true;
- io1.in.persistent_open = false;
- io1.in.create_guid = create_guid1;
- io1.in.timeout = UINT32_MAX;
- io1.in.timeout = 0x493E0; /* 300000 */
- /* windows 2016 returns 300000 0x493E0 */
+ test_multichannel_init_smb_create(&io1);
smb2_oplock_create_share(&io2, fname2,
smb2_util_share_access("RWD"),
smb2_util_oplock_level("b"));
- io2.in.durable_open = false;
- io2.in.durable_open_v2 = true;
- io2.in.persistent_open = false;
- io2.in.create_guid = create_guid2;
- io2.in.timeout = UINT32_MAX;
- io2.in.timeout = 0x493E0; /* 300000 */
+ test_multichannel_init_smb_create(&io2);
smb2_oplock_create_share(&io3, fname3,
smb2_util_share_access("RWD"),
smb2_util_oplock_level("b"));
- io3.in.durable_open = false;
- io3.in.durable_open_v2 = true;
- io3.in.persistent_open = false;
- io3.in.create_guid = create_guid3;
- io3.in.timeout = UINT32_MAX;
- io3.in.timeout = 0x493E0; /* 300000 */
+ test_multichannel_init_smb_create(&io3);
transport2_options = transport1->options;
rval = test_multichannel_create_channels2(tctx, host, share,
struct smb2_handle h_client2_file2 = { 0 };
struct smb2_handle h_client2_file3 = { 0 };
struct smb2_create io1, io2, io3;
- struct GUID create_guid1 = GUID_random();
- struct GUID create_guid2 = GUID_random();
- struct GUID create_guid3 = GUID_random();
bool ret = true;
int rval;
const char *fname1 = BASEDIR "\\lease_break_test1.dat";
transport1->lease.handler = torture_lease_handler;
transport1->lease.private_data = tree1;
torture_comment(tctx, "transport1 [%p]\n", transport1);
-
local_port = torture_get_local_port_from_transport(transport1);
torture_comment(tctx, "transport1 uses tcp port: %d\n", local_port);
smb2_lease_create(&io1, &ls1, false, fname1, LEASE2F1,
smb2_util_lease_state("RHW"));
- io1.in.durable_open = false;
- io1.in.durable_open_v2 = true;
- io1.in.persistent_open = false;
- io1.in.create_guid = create_guid1;
- io1.in.timeout = 0x493E0;
+ test_multichannel_init_smb_create(&io1);
smb2_lease_create(&io2, &ls2, false, fname2, LEASE2F2,
smb2_util_lease_state("RHW"));
- io2.in.durable_open = false;
- io2.in.durable_open_v2 = true;
- io2.in.persistent_open = false;
- io2.in.create_guid = create_guid2;
- io2.in.timeout = 0x493E0;
+ test_multichannel_init_smb_create(&io2);
smb2_lease_create(&io3, &ls3, false, fname3, LEASE2F3,
smb2_util_lease_state("RHW"));
- io3.in.durable_open = false;
- io3.in.durable_open_v2 = true;
- io3.in.persistent_open = false;
- io3.in.create_guid = create_guid3;
- io3.in.timeout = 0x493E0;
+ test_multichannel_init_smb_create(&io3);
transport2_options = transport1->options;