summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_pipe.c
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2002-01-02 05:39:49 +0000
committerMartin Pool <mbp@samba.org>2002-01-02 05:39:49 +0000
commitf23cc6ab25b8b642c713b571ca77304178070339 (patch)
tree275c21f73e9f1a18096e78a1c65b700c00a441cd /source3/rpc_client/cli_pipe.c
parent8d5f5825c4a534a0704e52f93eba878b860c4835 (diff)
downloadsamba-f23cc6ab25b8b642c713b571ca77304178070339.tar.gz
samba-f23cc6ab25b8b642c713b571ca77304178070339.tar.bz2
samba-f23cc6ab25b8b642c713b571ca77304178070339.zip
struct cli_state remembers the pipe name that it's talking to, if any,
so that we can print it in later debug messages. Call prs_dump to dump out requests sent by the client at sufficiently high debug levels. (This used to be commit 9973b22b34dc2a88a20b821d4e69f39d2a6aa6a3)
Diffstat (limited to 'source3/rpc_client/cli_pipe.c')
-rw-r--r--source3/rpc_client/cli_pipe.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 6eaab39bcc..829692ccc3 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -770,9 +770,12 @@ static BOOL create_rpc_request(prs_struct *rpc_out, uint8 op_num, int data_len,
}
-/****************************************************************************
- Send a request on an rpc pipe.
- ****************************************************************************/
+/**
+ * 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.
+**/
BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
prs_struct *data, prs_struct *rdata)
@@ -785,10 +788,16 @@ 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(dump_name, op_num, data);
+
/*
* The auth_len doesn't include the RPC_HDR_AUTH_LEN.
*/
@@ -1246,9 +1255,19 @@ 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
****************************************************************************/