summaryrefslogtreecommitdiff
path: root/source/torture/smb2
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-05-29 19:16:44 +1000
committerAndrew Tridgell <tridge@samba.org>2008-05-29 19:16:44 +1000
commit23ffec5d140463c8307fd7e444ae25781ea3d792 (patch)
tree2887ad56ac5b10ab4a6a382045fbd821f8956567 /source/torture/smb2
parent4eb49335d5f0319f9aa47ded5215a2977d3336bf (diff)
downloadsamba-23ffec5d140463c8307fd7e444ae25781ea3d792.tar.gz
test the maximal access return
Diffstat (limited to 'source/torture/smb2')
-rw-r--r--source/torture/smb2/create.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/torture/smb2/create.c b/source/torture/smb2/create.c
index 58d38a2cb33..eb6b333ef5d 100644
--- a/source/torture/smb2/create.c
+++ b/source/torture/smb2/create.c
@@ -41,7 +41,7 @@
if (v != correct) { \
printf("(%s) Incorrect value for %s 0x%08llx - should be 0x%08llx\n", \
__location__, #v, (unsigned long long)v, (unsigned long long)correct); \
- return false; \
+ return false; \
}} while (0)
/*
@@ -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;
+ union smb_fileinfo q;
ZERO_STRUCT(io);
io.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -181,6 +182,20 @@ 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.fname = FNAME;
+ io.in.file_attributes = 0;
+ io.in.desired_access = SEC_FILE_READ_DATA | SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA;
+ io.in.query_maximal_access = true;
+ status = smb2_create(tree, tmp_ctx, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ CHECK_EQUAL(io.out.maximal_access, 0x001f01ff);
+
+ q.access_information.level = RAW_FILEINFO_ACCESS_INFORMATION;
+ q.access_information.in.file.handle = io.out.file.handle;
+ status = smb2_getinfo_file(tree, tmp_ctx, &q);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ CHECK_EQUAL(q.access_information.out.access_flags, io.in.desired_access);
+
talloc_free(tmp_ctx);
smb2_deltree(tree, FNAME);