diff options
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/smb2/durable_v2_open.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/source4/torture/smb2/durable_v2_open.c b/source4/torture/smb2/durable_v2_open.c index 85620965d1..576fde284d 100644 --- a/source4/torture/smb2/durable_v2_open.c +++ b/source4/torture/smb2/durable_v2_open.c @@ -382,7 +382,8 @@ bool test_durable_v2_open_reopen1(struct torture_context *tctx, char fname[256]; struct smb2_handle _h; struct smb2_handle *h = NULL; - struct smb2_create io1, io2; + struct smb2_create io; + struct GUID create_guid = GUID_random(); bool ret = true; /* Choose a random name in case the state is left a little funky. */ @@ -391,32 +392,32 @@ bool test_durable_v2_open_reopen1(struct torture_context *tctx, smb2_util_unlink(tree, fname); - smb2_oplock_create_share(&io1, fname, + smb2_oplock_create_share(&io, fname, smb2_util_share_access(""), 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 = GUID_random(); - io1.in.timeout = UINT32_MAX; + io.in.durable_open = false; + io.in.durable_open_v2 = true; + io.in.persistent_open = false; + io.in.create_guid = create_guid; + io.in.timeout = UINT32_MAX; - status = smb2_create(tree, mem_ctx, &io1); + status = smb2_create(tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); - _h = io1.out.file.handle; + _h = io.out.file.handle; h = &_h; - CHECK_CREATED(&io1, CREATED, FILE_ATTRIBUTE_ARCHIVE); - CHECK_VAL(io1.out.oplock_level, smb2_util_oplock_level("b")); - CHECK_VAL(io1.out.durable_open, false); - CHECK_VAL(io1.out.durable_open_v2, true); - CHECK_VAL(io1.out.persistent_open, false); - CHECK_VAL(io1.out.timeout, io1.in.timeout); + CHECK_CREATED(&io, CREATED, FILE_ATTRIBUTE_ARCHIVE); + CHECK_VAL(io.out.oplock_level, smb2_util_oplock_level("b")); + CHECK_VAL(io.out.durable_open, false); + CHECK_VAL(io.out.durable_open_v2, true); + CHECK_VAL(io.out.persistent_open, false); + CHECK_VAL(io.out.timeout, io.in.timeout); /* try a durable reconnect while the file is still open */ - ZERO_STRUCT(io2); - io2.in.fname = ""; - io2.in.durable_handle_v2 = h; - io2.in.create_guid = io1.in.create_guid; - status = smb2_create(tree, mem_ctx, &io2); + ZERO_STRUCT(io); + io.in.fname = ""; + io.in.durable_handle_v2 = h; + io.in.create_guid = create_guid; + status = smb2_create(tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); done: |