1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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 commit is contained in:
Martin Pool 0001-01-01 00:00:00 +00:00
parent 37ae84f782
commit 9973b22b34

View File

@ -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, BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
prs_struct *data, prs_struct *rdata) 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; BOOL auth_seal;
uint32 crc32 = 0; uint32 crc32 = 0;
char *pdata_out = NULL; char *pdata_out = NULL;
fstring dump_name;
auth_verify = ((cli->ntlmssp_srv_flgs & NTLMSSP_NEGOTIATE_SIGN) != 0); auth_verify = ((cli->ntlmssp_srv_flgs & NTLMSSP_NEGOTIATE_SIGN) != 0);
auth_seal = ((cli->ntlmssp_srv_flgs & NTLMSSP_NEGOTIATE_SEAL) != 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. * 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, "$"); fstrcat(cli->mach_acct, "$");
strupper(cli->mach_acct); strupper(cli->mach_acct);
/* Remember which pipe we're talking to */
fstrcpy(cli->pipe_name, pipe_name);
return True; return True;
} }
const char *cli_pipe_get_name(struct cli_state *cli)
{
return cli->pipe_name;
}
/**************************************************************************** /****************************************************************************
close the session close the session
****************************************************************************/ ****************************************************************************/