diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-08-14 13:12:07 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-08-14 13:13:52 +0200 |
commit | affba1f75cc1136c4ffe38f41ceb1f5626df2d07 (patch) | |
tree | a55203c268f2c0da714196458bf2fc116177baf3 /source4/torture/smb2 | |
parent | d6abf13510cf01a7deeee9543588015b4311a193 (diff) | |
download | samba-affba1f75cc1136c4ffe38f41ceb1f5626df2d07.tar.gz samba-affba1f75cc1136c4ffe38f41ceb1f5626df2d07.tar.bz2 samba-affba1f75cc1136c4ffe38f41ceb1f5626df2d07.zip |
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)
Diffstat (limited to 'source4/torture/smb2')
-rw-r--r-- | source4/torture/smb2/create.c | 23 |
1 files changed, 21 insertions, 2 deletions
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<<i; + if (io.in.file_attributes & FILE_ATTRIBUTE_ENCRYPTED) { + continue; + } smb2_deltree(tree, FNAME); status = smb2_create(tree, tmp_ctx, &io); if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER)) { @@ -195,10 +198,26 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre } } - CHECK_EQUAL(ok_mask, 0x00007fb7); + CHECK_EQUAL(ok_mask, 0x00003fb7); CHECK_EQUAL(invalid_parameter_mask, 0xffff8048); CHECK_EQUAL(unexpected_mask, 0x00000000); - CHECK_EQUAL(file_attributes_set, 0x00005127); + CHECK_EQUAL(file_attributes_set, 0x00001127); + + smb2_deltree(tree, FNAME); + + /* + * Standalone servers doesn't support encryption + */ + io.in.file_attributes = FILE_ATTRIBUTE_ENCRYPTED; + status = smb2_create(tree, tmp_ctx, &io); + if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) { + printf("FILE_ATTRIBUTE_ENCRYPTED returned %s\n", nt_errstr(status)); + } else { + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_EQUAL(io.out.file_attr, (FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_ARCHIVE)); + status = smb2_util_close(tree, io.out.file.handle); + CHECK_STATUS(status, NT_STATUS_OK); + } smb2_deltree(tree, FNAME); |