summaryrefslogtreecommitdiffstats
path: root/source/rpc_client/cli_pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/rpc_client/cli_pipe.c')
-rw-r--r--source/rpc_client/cli_pipe.c59
1 files changed, 17 insertions, 42 deletions
diff --git a/source/rpc_client/cli_pipe.c b/source/rpc_client/cli_pipe.c
index 0416ed3b9ba..d6332c83bc4 100644
--- a/source/rpc_client/cli_pipe.c
+++ b/source/rpc_client/cli_pipe.c
@@ -1,5 +1,6 @@
/*
- * Unix SMB/CIFS implementation.
+ * Unix SMB/Netbios implementation.
+ * Version 1.9.
* RPC Pipe client / server routines
* Copyright (C) Andrew Tridgell 1992-1998,
* Copyright (C) Luke Kenneth Casson Leighton 1996-1998,
@@ -23,9 +24,6 @@
#include "includes.h"
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_RPC_CLI
-
extern struct pipe_id_info pipe_names[];
extern fstring global_myworkgroup;
extern pstring global_myname;
@@ -82,13 +80,13 @@ static BOOL rpc_read(struct cli_state *cli, prs_struct *rdata, uint32 data_to_re
DEBUG(5,("rpc_read: num_read = %d, read offset: %d, to read: %d\n",
num_read, stream_offset, data_to_read));
- if (cli_is_dos_error(cli)) {
- cli_dos_error(cli, &eclass, &ecode);
- if (eclass != ERRDOS && ecode != ERRmoredata) {
+ if (cli_is_dos_error(cli)) {
+ cli_dos_error(cli, &eclass, &ecode);
+ if (eclass != ERRDOS && ecode != ERRmoredata) {
DEBUG(0,("rpc_read: Error %d/%u in cli_read\n",
eclass, (unsigned int)ecode));
- return False;
- }
+ return False;
+ }
}
data_to_read -= num_read;
@@ -354,7 +352,7 @@ static BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, prs_struct *data, pr
if (!cli_api_pipe(cli, "\\PIPE\\",
setup, 2, 0, /* Setup, length, max */
NULL, 0, 0, /* Params, length, max */
- pdata, data_len, 1024, /* data, length, max */
+ pdata, data_len, data_len, /* data, length, max */
&rparam, &rparam_len, /* return params, len */
&prdata, &rdata_len)) /* return data, len */
{
@@ -468,12 +466,13 @@ static BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, prs_struct *data, pr
prs_give_memory(&hps, hdr_data, sizeof(hdr_data), False);
num_read = cli_read(cli, cli->nt_pipe_fnum, hdr_data, 0, RPC_HEADER_LEN+RPC_HDR_RESP_LEN);
+
if (cli_is_dos_error(cli)) {
- cli_dos_error(cli, &eclass, &ecode);
- if (eclass != ERRDOS && ecode != ERRmoredata) {
- DEBUG(0,("rpc_api_pipe: cli_read error : %d/%d\n", eclass, ecode));
- return False;
- }
+ cli_dos_error(cli, &eclass, &ecode);
+ if (eclass != ERRDOS && ecode != ERRmoredata) {
+ DEBUG(0,("rpc_api_pipe: cli_read error : %d/%d\n", eclass, ecode));
+ return False;
+ }
}
DEBUG(5,("rpc_api_pipe: read header (size:%d)\n", num_read));
@@ -772,12 +771,9 @@ static BOOL create_rpc_request(prs_struct *rpc_out, uint8 op_num, int data_len,
}
-/**
- * Send a request on an RPC pipe and get a response.
- *
- * @param data NDR contents of the request to be sent.
- * @param rdata Unparsed NDR response data.
-**/
+/****************************************************************************
+ Send a request on an rpc pipe.
+ ****************************************************************************/
BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
prs_struct *data, prs_struct *rdata)
@@ -790,16 +786,10 @@ BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
BOOL auth_seal;
uint32 crc32 = 0;
char *pdata_out = NULL;
- fstring dump_name;
auth_verify = ((cli->ntlmssp_srv_flgs & NTLMSSP_NEGOTIATE_SIGN) != 0);
auth_seal = ((cli->ntlmssp_srv_flgs & NTLMSSP_NEGOTIATE_SEAL) != 0);
- /* Optionally capture for use in debugging */
- slprintf(dump_name, sizeof(dump_name) - 1, "call_%s",
- cli_pipe_get_name(cli));
- prs_dump_before(dump_name, op_num, data);
-
/*
* The auth_len doesn't include the RPC_HDR_AUTH_LEN.
*/
@@ -898,11 +888,6 @@ BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
ret = rpc_api_pipe(cli, 0x0026, &outgoing_packet, rdata);
- /* Also capture received data */
- slprintf(dump_name, sizeof(dump_name) - 1, "reply_%s",
- cli_pipe_get_name(cli));
- prs_dump(dump_name, op_num, rdata);
-
prs_mem_free(&outgoing_packet);
return ret;
@@ -1262,19 +1247,9 @@ BOOL cli_nt_session_open(struct cli_state *cli, const char *pipe_name)
fstrcat(cli->mach_acct, "$");
strupper(cli->mach_acct);
- /* Remember which pipe we're talking to */
- fstrcpy(cli->pipe_name, pipe_name);
-
return True;
}
-
-const char *cli_pipe_get_name(struct cli_state *cli)
-{
- return cli->pipe_name;
-}
-
-
/****************************************************************************
close the session
****************************************************************************/