diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-11-19 06:39:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:46:29 -0500 |
commit | fc04e3e795cebca5723c24e097f5374a23b2247b (patch) | |
tree | 88852c9d430623591fa004f7f21cac6b14c214a7 /source4/torture/smb2 | |
parent | 7d6f36682eab29cb23c40dd915acad61fb5d68cb (diff) | |
download | samba-fc04e3e795cebca5723c24e097f5374a23b2247b.tar.gz samba-fc04e3e795cebca5723c24e097f5374a23b2247b.tar.bz2 samba-fc04e3e795cebca5723c24e097f5374a23b2247b.zip |
r11801: - added basic SMB2 find support
- added SMB2-SCANFIND test
- cleaned up continue flags in EAs and find requests
(This used to be commit 8792bc07d927e6470874230153177748afae3ee8)
Diffstat (limited to 'source4/torture/smb2')
-rw-r--r-- | source4/torture/smb2/getinfo.c | 8 | ||||
-rw-r--r-- | source4/torture/smb2/scan.c | 48 |
2 files changed, 52 insertions, 4 deletions
diff --git a/source4/torture/smb2/getinfo.c b/source4/torture/smb2/getinfo.c index 7c0fe7fbd7..209c220e60 100644 --- a/source4/torture/smb2/getinfo.c +++ b/source4/torture/smb2/getinfo.c @@ -102,10 +102,10 @@ static BOOL torture_smb2_fileinfo(struct smb2_tree *tree) file_levels[i].dinfo.query_secdesc.secinfo_flags = 0x7; } if (file_levels[i].level == RAW_FILEINFO_SMB2_ALL_EAS) { - file_levels[i].finfo.all_eas.ea_flags = - SMB2_GETINFO_EA_FLAG_RESTART; - file_levels[i].dinfo.all_eas.ea_flags = - SMB2_GETINFO_EA_FLAG_RESTART; + file_levels[i].finfo.all_eas.continue_flags = + SMB2_CONTINUE_FLAG_RESTART; + file_levels[i].dinfo.all_eas.continue_flags = + SMB2_CONTINUE_FLAG_RESTART; } file_levels[i].finfo.generic.level = file_levels[i].level; file_levels[i].finfo.generic.in.handle = hfile; diff --git a/source4/torture/smb2/scan.c b/source4/torture/smb2/scan.c index 81e0bea69a..b0c4ba4c8d 100644 --- a/source4/torture/smb2/scan.c +++ b/source4/torture/smb2/scan.c @@ -146,6 +146,54 @@ BOOL torture_smb2_setinfo_scan(void) return True; } + +/* + scan for valid SMB2 scan levels +*/ +BOOL torture_smb2_find_scan(void) +{ + TALLOC_CTX *mem_ctx = talloc_new(NULL); + struct smb2_tree *tree; + NTSTATUS status; + struct smb2_find io; + struct smb2_handle handle; + int i; + + if (!torture_smb2_connection(mem_ctx, &tree)) { + return False; + } + + status = smb2_util_roothandle(tree, &handle); + if (!NT_STATUS_IS_OK(status)) { + printf("Failed to open roothandle - %s\n", nt_errstr(status)); + return False; + } + + ZERO_STRUCT(io); + io.in.pattern = "*"; + io.in.continue_flags = SMB2_CONTINUE_FLAG_RESTART; + io.in.max_response_size = 0x10000; + io.in.handle = handle; + + for (i=1;i<0x100;i++) { + io.in.level = i; + + io.in.handle = handle; + status = smb2_find(tree, mem_ctx, &io); + if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_INFO_CLASS) && + !NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER) && + !NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { + printf("find level 0x%04x is %d bytes - %s\n", + io.in.level, io.out.blob.length, nt_errstr(status)); + dump_data(1, io.out.blob.data, io.out.blob.length); + } + } + + talloc_free(mem_ctx); + + return True; +} + /* scan for valid SMB2 opcodes */ |