summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/torture/raw/qfileinfo.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c
index 4f6d8d56b9..1e7d9024e1 100644
--- a/source4/torture/raw/qfileinfo.c
+++ b/source4/torture/raw/qfileinfo.c
@@ -885,22 +885,39 @@ bool torture_raw_qfileinfo_pipe(struct torture_context *torture,
bool ret = true;
int fnum;
const char *fname = "\\lsass";
- struct dcerpc_pipe *p;
- struct smbcli_tree *ipc_tree;
+ union smb_open op;
NTSTATUS status;
- if (!(p = dcerpc_pipe_init(torture, torture->ev))) {
- return false;
- }
-
- status = dcerpc_pipe_open_smb(p, cli->tree, fname);
+ op.ntcreatex.level = RAW_OPEN_NTCREATEX;
+ op.ntcreatex.in.flags = 0;
+ op.ntcreatex.in.root_fid.fnum = 0;
+ op.ntcreatex.in.access_mask =
+ SEC_STD_READ_CONTROL |
+ SEC_FILE_WRITE_ATTRIBUTE |
+ SEC_FILE_WRITE_EA |
+ SEC_FILE_READ_DATA |
+ SEC_FILE_WRITE_DATA;
+ op.ntcreatex.in.file_attr = 0;
+ op.ntcreatex.in.alloc_size = 0;
+ op.ntcreatex.in.share_access =
+ NTCREATEX_SHARE_ACCESS_READ |
+ NTCREATEX_SHARE_ACCESS_WRITE;
+ op.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
+ op.ntcreatex.in.create_options = 0;
+ op.ntcreatex.in.impersonation =
+ NTCREATEX_IMPERSONATION_IMPERSONATION;
+ op.ntcreatex.in.security_flags = 0;
+ op.ntcreatex.in.fname = fname;
+
+ status = smb_raw_open(cli->tree, torture, &op);
torture_assert_ntstatus_ok(torture, status, "dcerpc_pipe_open_smb failed");
- ipc_tree = dcerpc_smb_tree(p->conn);
- fnum = dcerpc_smb_fnum(p->conn);
+ fnum = op.ntcreatex.out.file.fnum;
- ret = torture_raw_qfileinfo_internals(torture, torture, ipc_tree, fnum, fname, true /* is_ipc */);
-
- talloc_free(p);
+ ret = torture_raw_qfileinfo_internals(torture, torture, cli->tree,
+ fnum, fname,
+ true /* is_ipc */);
+
+ smbcli_close(cli->tree, fnum);
return ret;
}