diff options
author | Michael Adam <obnox@samba.org> | 2011-11-08 22:03:04 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-11-09 01:02:09 +0100 |
commit | 9d862c00e5563b8ccd47df18f7b7645b370620ab (patch) | |
tree | 129612ed52d15a9a5c62cd44a5e7c4997a90987a /source4/torture/smb2 | |
parent | 0652b21c68ba82c6cfa67a43318b756fb679a513 (diff) | |
download | samba-9d862c00e5563b8ccd47df18f7b7645b370620ab.tar.gz samba-9d862c00e5563b8ccd47df18f7b7645b370620ab.tar.bz2 samba-9d862c00e5563b8ccd47df18f7b7645b370620ab.zip |
s4:torture:smb2: rewrite the durable-open.lock test to use smb2_lease_create()
Diffstat (limited to 'source4/torture/smb2')
-rw-r--r-- | source4/torture/smb2/durable_open.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c index 7984e50635..8e43ddcc29 100644 --- a/source4/torture/smb2/durable_open.c +++ b/source4/torture/smb2/durable_open.c @@ -626,30 +626,10 @@ bool test_durable_open_lock(struct torture_context *tctx, smb2_util_unlink(tree, fname); /* Create with lease */ - ZERO_STRUCT(io); - io.in.security_flags = 0x00; - io.in.oplock_level = SMB2_OPLOCK_LEVEL_LEASE; - io.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION; - io.in.create_flags = 0x00000000; - io.in.reserved = 0x00000000; - io.in.desired_access = SEC_RIGHTS_FILE_ALL; - io.in.file_attributes = FILE_ATTRIBUTE_NORMAL; - io.in.share_access = NTCREATEX_SHARE_ACCESS_READ | - NTCREATEX_SHARE_ACCESS_WRITE | - NTCREATEX_SHARE_ACCESS_DELETE; - io.in.create_disposition = NTCREATEX_DISP_OPEN_IF; - io.in.create_options = NTCREATEX_OPTIONS_SEQUENTIAL_ONLY | - NTCREATEX_OPTIONS_ASYNC_ALERT | - NTCREATEX_OPTIONS_NON_DIRECTORY_FILE | - 0x00200000; - io.in.fname = fname; - io.in.durable_open = true; - ZERO_STRUCT(ls); - ls.lease_key.data[0] = lease; - ls.lease_key.data[1] = ~lease; - ls.lease_state = SMB2_LEASE_READ|SMB2_LEASE_HANDLE|SMB2_LEASE_WRITE; - io.in.lease_request = &ls; + smb2_lease_create(&io, &ls, false /* dir */, fname, lease, + smb2_util_lease_state("RWH")); + io.in.durable_open = true; status = smb2_create(tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); |