From 80f2f10839521a873c37e6000d14ce2df2690f7a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 14 Aug 2008 09:54:22 +0200 Subject: SMB2-CREATE: be more strict in error checking metze (This used to be commit d7d4df78c1de19d0cd7a63daaa2fa0863a243a12) --- source4/torture/smb2/create.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source4/torture/smb2/create.c') diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c index 744c5d2b6c..6edacbfd07 100644 --- a/source4/torture/smb2/create.c +++ b/source4/torture/smb2/create.c @@ -54,6 +54,7 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre 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; + uint32_t not_a_directory_mask, unexpected_mask; union smb_fileinfo q; ZERO_STRUCT(io); @@ -104,7 +105,11 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre 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; + ok_mask = 0; + not_supported_mask = 0; + invalid_parameter_mask = 0; + not_a_directory_mask = 0; + unexpected_mask = 0; { int i; for (i=0;i<32;i++) { @@ -117,11 +122,14 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre not_supported_mask |= 1< Date: Thu, 14 Aug 2008 09:54:51 +0200 Subject: SMB2-CREATE: be more strict in checking file attributes metze (This used to be commit ba9d0f6b3c60346df757e7c4c3f5704c0bf26d11) --- source4/torture/smb2/create.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'source4/torture/smb2/create.c') diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c index 6edacbfd07..a8effca396 100644 --- a/source4/torture/smb2/create.c +++ b/source4/torture/smb2/create.c @@ -52,7 +52,7 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre struct smb2_create io; NTSTATUS status; TALLOC_CTX *tmp_ctx = talloc_new(tree); - uint32_t access_mask, file_attributes, file_attributes_set, denied_mask; + uint32_t access_mask, file_attributes_set; uint32_t ok_mask, not_supported_mask, invalid_parameter_mask; uint32_t not_a_directory_mask, unexpected_mask; union smb_fileinfo q; @@ -166,9 +166,10 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre io.in.create_disposition = NTCREATEX_DISP_OPEN_IF; io.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED; io.in.file_attributes = 0; - file_attributes = 0; + ok_mask = 0; + invalid_parameter_mask = 0; + unexpected_mask = 0; file_attributes_set = 0; - denied_mask = 0; { int i; for (i=0;i<32;i++) { @@ -176,21 +177,28 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre smb2_deltree(tree, FNAME); status = smb2_create(tree, tmp_ctx, &io); if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER)) { - file_attributes |= io.in.file_attributes; - } else if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) { - denied_mask |= io.in.file_attributes; - } else { - CHECK_STATUS(status, NT_STATUS_OK); + invalid_parameter_mask |= 1< Date: Thu, 14 Aug 2008 13:12:07 +0200 Subject: SMB2-CREATE: add a special test for FILE_ATTRIBUTE_ENCRYPTED Some standalone server (and samba4) doesn't support this. metze (This used to be commit 6d8fd4c0089d7e632ec91027a77321aca8c6acc7) --- source4/torture/smb2/create.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'source4/torture/smb2/create.c') diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c index a8effca396..4d1b4a7ed0 100644 --- a/source4/torture/smb2/create.c +++ b/source4/torture/smb2/create.c @@ -174,6 +174,9 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre int i; for (i=0;i<32;i++) { io.in.file_attributes = 1<