From 4709373cdf75d9a84eaaf1f23cf4bf07b8cb63c5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 30 Jun 2014 09:37:47 +0000 Subject: [PATCH] torture: Add a check to verify MS-SMB2 3.3.5.14.2 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 Reviewed-by: Jeremy Allison --- selftest/knownfail | 1 + source4/torture/smb2/lock.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/selftest/knownfail b/selftest/knownfail index 434ce0c095b..deeb8fac695 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -115,6 +115,7 @@ ^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\(.*\)$ diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c index a27ae9054de..1886a56134d 100644 --- a/source4/torture/smb2/lock.c +++ b/source4/torture/smb2/lock.c @@ -274,6 +274,12 @@ static bool test_valid_request(struct torture_context *torture, 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; status = smb2_lock(tree, &lck); -- 2.11.4.GIT