summaryrefslogtreecommitdiff
path: root/source4/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
commit215fd9764fe9d595941a58d022a05a4f83365595 (patch)
tree93651da112c08a74709651adf4791bbb254c7d29 /source4/torture/smb2
parentc86dc11be6e626fa81f025d7ec78226fb4249cdc (diff)
downloadsamba-215fd9764fe9d595941a58d022a05a4f83365595.tar.gz
samba-215fd9764fe9d595941a58d022a05a4f83365595.tar.bz2
samba-215fd9764fe9d595941a58d022a05a4f83365595.zip
test the maximal access return
(This used to be commit 23ffec5d140463c8307fd7e444ae25781ea3d792)
Diffstat (limited to 'source4/torture/smb2')
-rw-r--r--source4/torture/smb2/create.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c
index 58d38a2cb3..eb6b333ef5 100644
--- a/source4/torture/smb2/create.c
+++ b/source4/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);