There are some places in torture/smb2/lock.c that should use valid lock flags as defined in MS-SMB2
@@ -82,7 +82,7 @@ static bool test_valid_request(struct torture_context *tor
el.offset = 0;
el.length = 0;
el.reserved = 0x00000000;
el.flags = SMB2_LOCK_FLAG_NONE;
status = smb2_lock(tree, &lck);
SMB2_LOCK_FLAG_NONE is not a valid flag and it will make server return INVALID_PARAMETER. Lock flags are described in MS-SMB2 188.8.131.52(http://msdn.microsoft.com/en-us/library/cc246538(PROT.10).aspx)
The same issue goes for line 187, 240, 261, 282, 283, 289, 309
test_lock_rw_none() should be removed or changed to use a valid flag.
Add metze to CC list since he does some work on SMB(2) and torture.
I still find a "SMB2_LOCK_FLAG_NONE" in the SMB2 lock test. Metze, would you like to work on this?
Tim Prouty, since you have worked lately on s4 torture: would you like to fix this?
I think I've already fixed this issue. I'll take a look.
The flags field was not properly validated in W2K8 when this test was first
written. Since then the MS-SMB2 doc has been updated to clearly describe what
combination of flags are valid and which ones are not, and W2K8R2 follows this
The tests in SMB2-LOCK now explicitly give invalid flags only to see if the server will return STATUS_INVALID_PARAMETER. In other tests, valid flags are
given. The exception to this rule is if the server target is specified as
W2K8R2, in which case giving invalid flags is accepted by the server and a
torture_warning() is raised.