1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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>
This commit is contained in:
Stefan Metzmacher 2013-09-17 07:01:57 +02:00 committed by Andrew Bartlett
parent a3074521d4
commit 3b53566ebb

View File

@ -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;
}
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 = dcerpc_pipe_open_smb(p, cli->tree, 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;
}