summaryrefslogtreecommitdiff
path: root/source4/torture/smb2
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/smb2')
-rw-r--r--source4/torture/smb2/connect.c10
-rw-r--r--source4/torture/smb2/getinfo.c10
-rw-r--r--source4/torture/smb2/lock.c8
-rw-r--r--source4/torture/smb2/scan.c15
-rw-r--r--source4/torture/smb2/util.c43
5 files changed, 46 insertions, 40 deletions
diff --git a/source4/torture/smb2/connect.c b/source4/torture/smb2/connect.c
index f1bc63dbbb..0004ea958e 100644
--- a/source4/torture/smb2/connect.c
+++ b/source4/torture/smb2/connect.c
@@ -147,10 +147,10 @@ static struct smb2_handle torture_smb2_create(struct smb2_tree *tree,
TALLOC_CTX *tmp_ctx = talloc_new(tree);
ZERO_STRUCT(io);
- io.in.oplock_flags = 0;
- io.in.access_mask = SEC_RIGHTS_FILE_ALL;
- io.in.file_attr = FILE_ATTRIBUTE_NORMAL;
- io.in.open_disposition = NTCREATEX_DISP_OPEN_IF;
+ io.in.oplock_level = 0;
+ io.in.desired_access = SEC_RIGHTS_FILE_ALL;
+ io.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
+ io.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
io.in.share_access =
NTCREATEX_SHARE_ACCESS_DELETE|
NTCREATEX_SHARE_ACCESS_READ|
@@ -166,7 +166,7 @@ static struct smb2_handle torture_smb2_create(struct smb2_tree *tree,
if (DEBUGLVL(1)) {
printf("Open gave:\n");
- printf("oplock_flags = 0x%x\n", io.out.oplock_flags);
+ printf("oplock_flags = 0x%x\n", io.out.oplock_level);
printf("create_action = 0x%x\n", io.out.create_action);
printf("create_time = %s\n", nt_time_string(tmp_ctx, io.out.create_time));
printf("access_time = %s\n", nt_time_string(tmp_ctx, io.out.access_time));
diff --git a/source4/torture/smb2/getinfo.c b/source4/torture/smb2/getinfo.c
index f561b62d47..c47a26277c 100644
--- a/source4/torture/smb2/getinfo.c
+++ b/source4/torture/smb2/getinfo.c
@@ -51,7 +51,9 @@ static struct {
{ LEVEL(RAW_FILEINFO_COMPRESSION_INFORMATION) },
{ LEVEL(RAW_FILEINFO_NETWORK_OPEN_INFORMATION) },
{ LEVEL(RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION) },
- { LEVEL(RAW_FILEINFO_SMB2_ALL_EAS) },
+/*
+disabled until we know how the alignment now works
+{ LEVEL(RAW_FILEINFO_SMB2_ALL_EAS) }, */
{ LEVEL(RAW_FILEINFO_SMB2_ALL_INFORMATION) },
{ LEVEL(RAW_FILEINFO_SEC_DESC) }
};
@@ -85,13 +87,13 @@ static bool torture_smb2_fileinfo(struct torture_context *tctx, struct smb2_tree
status = torture_smb2_testfile(tree, FNAME, &hfile);
if (!NT_STATUS_IS_OK(status)) {
- printf("Unable to create test file '%s' - %s\n", FNAME, nt_errstr(status));
+ printf(__location__ " Unable to create test file '%s' - %s\n", FNAME, nt_errstr(status));
goto failed;
}
status = torture_smb2_testdir(tree, DNAME, &hdir);
if (!NT_STATUS_IS_OK(status)) {
- printf("Unable to create test directory '%s' - %s\n", DNAME, nt_errstr(status));
+ printf(__location__ " Unable to create test directory '%s' - %s\n", DNAME, nt_errstr(status));
goto failed;
}
@@ -150,7 +152,7 @@ static bool torture_smb2_fsinfo(struct smb2_tree *tree)
printf("Testing fsinfo levels\n");
status = smb2_util_roothandle(tree, &handle);
if (!NT_STATUS_IS_OK(status)) {
- printf("Unable to create test directory '%s' - %s\n", DNAME, nt_errstr(status));
+ printf(__location__ " Unable to create root handle - %s\n", nt_errstr(status));
return false;
}
diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c
index 98e412817b..3cf2e93ee0 100644
--- a/source4/torture/smb2/lock.c
+++ b/source4/torture/smb2/lock.c
@@ -238,10 +238,10 @@ static bool test_lock_read_write(struct torture_context *torture,
CHECK_VALUE(lck.out.unknown1, 0);
ZERO_STRUCT(cr);
- cr.in.oplock_flags = 0;
- cr.in.access_mask = SEC_RIGHTS_FILE_ALL;
- cr.in.file_attr = FILE_ATTRIBUTE_NORMAL;
- cr.in.open_disposition = NTCREATEX_DISP_OPEN_IF;
+ cr.in.oplock_level = 0;
+ cr.in.desired_access = SEC_RIGHTS_FILE_ALL;
+ cr.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
+ cr.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
cr.in.share_access =
NTCREATEX_SHARE_ACCESS_DELETE|
NTCREATEX_SHARE_ACCESS_READ|
diff --git a/source4/torture/smb2/scan.c b/source4/torture/smb2/scan.c
index 84be11c047..0f4c9fefdf 100644
--- a/source4/torture/smb2/scan.c
+++ b/source4/torture/smb2/scan.c
@@ -68,19 +68,21 @@ bool torture_smb2_getinfo_scan(struct torture_context *torture)
ZERO_STRUCT(io);
- io.in.max_response_size = 0xFFFF;
+ io.in.output_buffer_length = 0xFFFF;
for (c=1;c<5;c++) {
for (i=0;i<0x100;i++) {
- io.in.level = (i<<8) | c;
+ io.in.info_type = c;
+ io.in.info_class = i;
io.in.file.handle = fhandle;
status = smb2_getinfo(tree, torture, &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("file level 0x%04x is %ld bytes - %s\n",
- io.in.level, (long)io.out.blob.length, nt_errstr(status));
+ printf("file level 0x%02x:%02x is %ld bytes - %s\n",
+ io.in.info_type, io.in.info_class,
+ (long)io.out.blob.length, nt_errstr(status));
dump_data(1, io.out.blob.data, io.out.blob.length);
}
@@ -89,8 +91,9 @@ bool torture_smb2_getinfo_scan(struct torture_context *torture)
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("dir level 0x%04x is %ld bytes - %s\n",
- io.in.level, (long)io.out.blob.length, nt_errstr(status));
+ printf("dir level 0x%02x:%02x is %ld bytes - %s\n",
+ io.in.info_type, io.in.info_class,
+ (long)io.out.blob.length, nt_errstr(status));
dump_data(1, io.out.blob.data, io.out.blob.length);
}
}
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c
index fe88296a32..f85b1c42ff 100644
--- a/source4/torture/smb2/util.c
+++ b/source4/torture/smb2/util.c
@@ -55,9 +55,9 @@ NTSTATUS smb2_util_unlink(struct smb2_tree *tree, const char *fname)
NTSTATUS status;
ZERO_STRUCT(io);
- io.in.access_mask = SEC_RIGHTS_FILE_ALL;
- io.in.file_attr = FILE_ATTRIBUTE_NORMAL;
- io.in.open_disposition = NTCREATEX_DISP_OPEN;
+ io.in.desired_access = SEC_RIGHTS_FILE_ALL;
+ io.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
+ io.in.create_disposition = NTCREATEX_DISP_OPEN;
io.in.share_access =
NTCREATEX_SHARE_ACCESS_DELETE|
NTCREATEX_SHARE_ACCESS_READ|
@@ -107,9 +107,9 @@ static NTSTATUS smb2_create_complex(struct smb2_tree *tree, const char *fname,
smb2_util_unlink(tree, fname);
ZERO_STRUCT(io);
- io.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
- io.in.file_attr = FILE_ATTRIBUTE_NORMAL;
- io.in.open_disposition = NTCREATEX_DISP_OVERWRITE_IF;
+ io.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED;
+ io.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
+ io.in.create_disposition = NTCREATEX_DISP_OVERWRITE_IF;
io.in.share_access =
NTCREATEX_SHARE_ACCESS_DELETE|
NTCREATEX_SHARE_ACCESS_READ|
@@ -119,10 +119,11 @@ static NTSTATUS smb2_create_complex(struct smb2_tree *tree, const char *fname,
if (dir) {
io.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
io.in.share_access &= ~NTCREATEX_SHARE_ACCESS_DELETE;
- io.in.file_attr = FILE_ATTRIBUTE_DIRECTORY;
- io.in.open_disposition = NTCREATEX_DISP_CREATE;
+ io.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
+ io.in.create_disposition = NTCREATEX_DISP_CREATE;
}
+ /* it seems vista is now fussier about alignment? */
if (strchr(fname, ':') == NULL) {
/* setup some EAs */
io.in.eas.num_eas = 2;
@@ -334,10 +335,10 @@ NTSTATUS torture_smb2_testfile(struct smb2_tree *tree, const char *fname,
NTSTATUS status;
ZERO_STRUCT(io);
- io.in.oplock_flags = 0;
- io.in.access_mask = SEC_RIGHTS_FILE_ALL;
- io.in.file_attr = FILE_ATTRIBUTE_NORMAL;
- io.in.open_disposition = NTCREATEX_DISP_OPEN_IF;
+ io.in.oplock_level = 0;
+ io.in.desired_access = SEC_RIGHTS_FILE_ALL;
+ io.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
+ io.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
io.in.share_access =
NTCREATEX_SHARE_ACCESS_DELETE|
NTCREATEX_SHARE_ACCESS_READ|
@@ -370,10 +371,10 @@ NTSTATUS torture_smb2_testdir(struct smb2_tree *tree, const char *fname,
NTSTATUS status;
ZERO_STRUCT(io);
- io.in.oplock_flags = 0;
- io.in.access_mask = SEC_RIGHTS_DIR_ALL;
- io.in.file_attr = FILE_ATTRIBUTE_DIRECTORY;
- io.in.open_disposition = NTCREATEX_DISP_OPEN_IF;
+ io.in.oplock_level = 0;
+ io.in.desired_access = SEC_RIGHTS_DIR_ALL;
+ io.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
+ io.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
io.in.share_access = NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE;
io.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
io.in.fname = fname;
@@ -422,13 +423,13 @@ NTSTATUS smb2_util_roothandle(struct smb2_tree *tree, struct smb2_handle *handle
NTSTATUS status;
ZERO_STRUCT(io);
- io.in.oplock_flags = 0;
- io.in.access_mask = SEC_STD_SYNCHRONIZE | SEC_DIR_READ_ATTRIBUTE | SEC_DIR_LIST;
- io.in.file_attr = 0;
- io.in.open_disposition = NTCREATEX_DISP_OPEN;
+ io.in.oplock_level = 0;
+ io.in.desired_access = SEC_STD_SYNCHRONIZE | SEC_DIR_READ_ATTRIBUTE | SEC_DIR_LIST;
+ io.in.file_attributes = 0;
+ io.in.create_disposition = NTCREATEX_DISP_OPEN;
io.in.share_access = NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_DELETE;
io.in.create_options = NTCREATEX_OPTIONS_ASYNC_ALERT;
- io.in.fname = "";
+ io.in.fname = NULL;
status = smb2_create(tree, tree, &io);
NT_STATUS_NOT_OK_RETURN(status);