diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-09-17 07:01:57 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-10-17 08:48:47 +1300 |
commit | 3b53566ebb2be28dae82198e35bc27003eaf7b21 (patch) | |
tree | 293c3577a0a824f7cb968f6be6692f108969df81 /source4/torture/raw | |
parent | a3074521d408acc4de8a6f810a99f0d6b0c0e324 (diff) | |
download | samba-3b53566ebb2be28dae82198e35bc27003eaf7b21.tar.gz samba-3b53566ebb2be28dae82198e35bc27003eaf7b21.tar.bz2 samba-3b53566ebb2be28dae82198e35bc27003eaf7b21.zip |
s4:tortore:raw/qfileinfo: don't use dcerpc_pipe_open_smb() to open a named pipe
We can directly use smb_raw_open() to open a handle to a named pipe.
This avoids the need for the layer violation functions
dcerpc_smb_tree() and dcerpc_smb_fnum().
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/torture/raw')
-rw-r--r-- | source4/torture/raw/qfileinfo.c | 41 |
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; } |