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/scan.c | |
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/scan.c')
-rw-r--r-- | source4/torture/smb2/scan.c | 48 |
1 files changed, 48 insertions, 0 deletions
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 */ |