From 336f6810cec9b30ad497da26ee463ed5736db2bd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Aug 2008 17:26:30 +1000 Subject: expanded the SMB2-CREATE and RAW-OPEN tests to explore more of how the create options fields are supposed to work (This used to be commit 0576875eccaa21ad529c9db41db91781ad400d0f) --- source4/torture/smb2/create.c | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'source4/torture/smb2/create.c') diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c index c23ff8b8ce..744c5d2b6c 100644 --- a/source4/torture/smb2/create.c +++ b/source4/torture/smb2/create.c @@ -53,6 +53,7 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre NTSTATUS status; TALLOC_CTX *tmp_ctx = talloc_new(tree); uint32_t access_mask, file_attributes, file_attributes_set, denied_mask; + uint32_t ok_mask, not_supported_mask, invalid_parameter_mask; union smb_fileinfo q; ZERO_STRUCT(io); @@ -76,14 +77,6 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre status = smb2_create(tree, tmp_ctx, &io); CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER); - io.in.create_options = 0x00100000; - status = smb2_create(tree, tmp_ctx, &io); - CHECK_STATUS(status, NT_STATUS_NOT_SUPPORTED); - - io.in.create_options = 0xF0100000; - status = smb2_create(tree, tmp_ctx, &io); - CHECK_STATUS(status, NT_STATUS_NOT_SUPPORTED); - io.in.create_options = 0; io.in.file_attributes = FILE_ATTRIBUTE_DEVICE; @@ -108,6 +101,37 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre status = smb2_create(tree, tmp_ctx, &io); CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED); + io.in.file_attributes = 0; + io.in.create_disposition = NTCREATEX_DISP_OPEN_IF; + io.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED; + ok_mask = not_supported_mask = invalid_parameter_mask = 0; + { + int i; + for (i=0;i<32;i++) { + io.in.create_options = 1<