summaryrefslogtreecommitdiff
path: root/source4/torture/smb2/util.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-11-19 05:55:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:29 -0500
commit7d6f36682eab29cb23c40dd915acad61fb5d68cb (patch)
tree010c93a8e05e068af92ea1673bff3ea890a59556 /source4/torture/smb2/util.c
parent931b1974a27b929b5b40d65d986f6381a0bc0daa (diff)
downloadsamba-7d6f36682eab29cb23c40dd915acad61fb5d68cb.tar.gz
samba-7d6f36682eab29cb23c40dd915acad61fb5d68cb.tar.bz2
samba-7d6f36682eab29cb23c40dd915acad61fb5d68cb.zip
r11800: - filled in unknown fields in SMB2 all_info level
- allow setting of the ALL_EAS flags bits in SMB2 getinfo (This used to be commit 8c7c54a46dfb91c053d07a5e606892a41213c605)
Diffstat (limited to 'source4/torture/smb2/util.c')
-rw-r--r--source4/torture/smb2/util.c47
1 files changed, 37 insertions, 10 deletions
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c
index b39f53d8e1..886aaea09f 100644
--- a/source4/torture/smb2/util.c
+++ b/source4/torture/smb2/util.c
@@ -232,8 +232,8 @@ void torture_smb2_all_info(struct smb2_tree *tree, struct smb2_handle handle)
d_printf("\tfile_id: %llu\n", io.all_info2.out.file_id);
d_printf("\tea_size: %u\n", io.all_info2.out.ea_size);
d_printf("\taccess_mask: 0x%08x\n", io.all_info2.out.access_mask);
- d_printf("\tunknown2: 0x%llx\n", io.all_info2.out.unknown2);
- d_printf("\tunknown3: 0x%llx\n", io.all_info2.out.unknown3);
+ d_printf("\tposition: 0x%llx\n", io.all_info2.out.position);
+ d_printf("\tmode: 0x%llx\n", io.all_info2.out.mode);
/* short name, if any */
io.generic.level = RAW_FILEINFO_ALT_NAME_INFORMATION;
@@ -270,14 +270,16 @@ void torture_smb2_all_info(struct smb2_tree *tree, struct smb2_handle handle)
}
}
- /* the security descriptor */
- io.query_secdesc.level = RAW_FILEINFO_SEC_DESC;
- io.query_secdesc.secinfo_flags =
- SECINFO_OWNER|SECINFO_GROUP|
- SECINFO_DACL;
- status = smb2_getinfo_file(tree, tmp_ctx, &io);
- if (NT_STATUS_IS_OK(status)) {
- NDR_PRINT_DEBUG(security_descriptor, io.query_secdesc.out.sd);
+ if (DEBUGLVL(1)) {
+ /* the security descriptor */
+ io.query_secdesc.level = RAW_FILEINFO_SEC_DESC;
+ io.query_secdesc.secinfo_flags =
+ SECINFO_OWNER|SECINFO_GROUP|
+ SECINFO_DACL;
+ status = smb2_getinfo_file(tree, tmp_ctx, &io);
+ if (NT_STATUS_IS_OK(status)) {
+ NDR_PRINT_DEBUG(security_descriptor, io.query_secdesc.out.sd);
+ }
}
talloc_free(tmp_ctx);
@@ -394,3 +396,28 @@ NTSTATUS torture_setup_complex_dir(struct smb2_tree *tree, const char *fname)
return smb2_util_close(tree, handle);
}
+
+/*
+ return a handle to the root of the share
+*/
+NTSTATUS smb2_util_roothandle(struct smb2_tree *tree, struct smb2_handle *handle)
+{
+ struct smb2_create io;
+ 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.share_access = NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_DELETE;
+ io.in.create_options = NTCREATEX_OPTIONS_ASYNC_ALERT;
+ io.in.fname = "";
+
+ status = smb2_create(tree, tree, &io);
+ NT_STATUS_NOT_OK_RETURN(status);
+
+ *handle = io.out.handle;
+
+ return NT_STATUS_OK;
+}