From 7ba8dca59094eb83cbcec4011b0ec632956f27af Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 May 2008 13:14:36 +1000 Subject: fixes to the SMB2 lock test after recent SMB2 locking changes (This used to be commit de7626e1c29f04e54afb6d95f4051bc52b17dd80) --- source4/torture/smb2/lock.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c index e81647b497..1a56cb9cad 100644 --- a/source4/torture/smb2/lock.c +++ b/source4/torture/smb2/lock.c @@ -90,7 +90,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree lck.in.file.handle.data[0] -=1; lck.in.lock_count = 0x0001; - lck.in.reserved = 0xFFFFFFFF; + lck.in.reserved = 0x123ab1; lck.in.file.handle = h; el[0].offset = UINT64_MAX; el[0].length = UINT64_MAX; @@ -100,16 +100,20 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(lck.out.reserved, 0); + lck.in.reserved = 0x123ab2; status = smb2_lock(tree, &lck); CHECK_STATUS(status, NT_STATUS_LOCK_NOT_GRANTED); + lck.in.reserved = 0x123ab3; status = smb2_lock(tree, &lck); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(lck.out.reserved, 0); + lck.in.reserved = 0x123ab4; status = smb2_lock(tree, &lck); CHECK_STATUS(status, NT_STATUS_LOCK_NOT_GRANTED); + lck.in.reserved = 0x123ab5; status = smb2_lock(tree, &lck); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(lck.out.reserved, 0); @@ -162,27 +166,27 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree lck.in.file.handle = h; el[0].offset = 0x00000000FFFFFFFF; el[0].length = 0x00000000FFFFFFFF; - el[0].reserved = 0x12345678; + el[0].reserved = 0x1234567; el[0].flags = SMB2_LOCK_FLAG_UNLOCK; status = smb2_lock(tree, &lck); - CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED); + CHECK_STATUS(status, NT_STATUS_OK); lck.in.lock_count = 0x0001; - lck.in.reserved = 0x12345678; + lck.in.reserved = 0x1234567; lck.in.file.handle = h; el[0].offset = 0x00000000FFFFFFFF; el[0].length = 0x00000000FFFFFFFF; el[0].reserved = 0x00000000; el[0].flags = SMB2_LOCK_FLAG_UNLOCK; status = smb2_lock(tree, &lck); - CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED); + CHECK_STATUS(status, NT_STATUS_OK); status = smb2_lock(tree, &lck); - CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED); + CHECK_STATUS(status, NT_STATUS_OK); status = smb2_lock(tree, &lck); - CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED); + CHECK_STATUS(status, NT_STATUS_OK); status = smb2_lock(tree, &lck); - CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED); + CHECK_STATUS(status, NT_STATUS_OK); done: return ret; -- cgit