torture: Add a check to verify MS-SMB2 3.3.5.14.2
authorVolker Lendecke <vl@samba.org>
Mon, 30 Jun 2014 09:37:47 +0000 (09:37 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 1 Jul 2014 22:11:23 +0000 (00:11 +0200)
If we have more than one lock and there is any blocking lock, we need
to fail with NT_STATUS_INVALID_PARAMETER. At a quick glance I did not
find this tested, so add it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/knownfail
source4/torture/smb2/lock.c

index 434ce0c095b61d79962152837d48d71c38769769..deeb8fac6956bd75d63916efba288abb1968b40d 100644 (file)
 ^samba4.smb2.oplock.doc
 ^samba4.smb2.compound.related3
 ^samba4.smb2.compound.compound-break
+^samba4.smb2.lock.valid-request
 ^samba4.*base.delaywrite.*update of write time and SMBwrite truncate\(.*\)$
 ^samba4.*base.delaywrite.*update of write time and SMBwrite truncate expand\(.*\)$
 ^samba4.*base.delaywrite.*delayed update of write time 3a\(.*\)$
index a27ae9054deca8db5ca64aaeb7e45489a1a44556..1886a56134de7eb782f72817806f5fe5450ea174 100644 (file)
@@ -273,6 +273,12 @@ static bool test_valid_request(struct torture_context *torture,
        status = smb2_lock(tree, &lck);
        CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
 
+       lck.in.lock_count       = 2;
+       el[0].flags = SMB2_LOCK_FLAG_SHARED|SMB2_LOCK_FLAG_FAIL_IMMEDIATELY;
+       el[1].flags = SMB2_LOCK_FLAG_SHARED;
+       status = smb2_lock(tree, &lck);
+       CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+
        lck.in.lock_count       = 2;
        el[0].flags             = 0;
        el[1].flags             = 0;