summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/smb2/getinfo.c8
-rw-r--r--source4/torture/smb2/scan.c48
-rw-r--r--source4/torture/torture.c1
3 files changed, 53 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
*/
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 434bca2500..e4ceffc02a 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -2256,6 +2256,7 @@ static struct {
{"SMB2-SCAN", torture_smb2_scan, 0},
{"SMB2-SCANGETINFO", torture_smb2_getinfo_scan, 0},
{"SMB2-SCANSETINFO", torture_smb2_setinfo_scan, 0},
+ {"SMB2-SCANFIND", torture_smb2_find_scan, 0},
{"SMB2-GETINFO", torture_smb2_getinfo, 0},
{"SMB2-SETINFO", torture_smb2_setinfo, 0},