From fbd17c8dafeefac788f4bc1c41045726825f513f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 3 Jan 2000 19:19:48 +0000 Subject: simple mods to add msrpc pipe redirection. default behaviour: fall back to using internal msrpc code in smbd. (This used to be commit 8976e26d46cb991710bc77463f7f928ac00dd4d8) --- source3/smbd/ipc.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'source3/smbd/ipc.c') diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index 4e9418fa94..cb4127aee4 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -3154,11 +3154,20 @@ static BOOL api_WPrintPortEnum(connection_struct *conn,uint16 vuid, char *param, Start the first part of an RPC reply which began with an SMBtrans request. ****************************************************************************/ -static BOOL api_rpc_trans_reply(char *outbuf, pipes_struct *p) +static BOOL api_rpc_trans_reply(char *outbuf, pipes_struct *p, + char *redir_data, int redir_len) { - char *rdata = malloc(p->max_trans_reply); + char *rdata; int data_len; + if (redir_data != NULL) + { + send_trans_reply(outbuf, NULL, 0, redir_data, redir_len, + redir_len > p->max_trans_reply); + return True; + } + + rdata = malloc(p->max_trans_reply); if(rdata == NULL) { DEBUG(0,("api_rpc_trans_reply: malloc fail.\n")); return False; @@ -3284,11 +3293,23 @@ static int api_fd_reply(connection_struct *conn,uint16 vuid,char *outbuf, switch (subcommand) { case 0x26: - /* dce/rpc command */ - reply = rpc_command(p, data, tdscnt); + { + char *rdata = NULL; + int rlen = mdrcnt; + + if (p->m) + { + reply = readwrite_pipe(p, data, tdscnt, &rdata, &rlen); + } + else + { + /* dce/rpc command */ + reply = rpc_command(p, data, tdscnt); + } if (reply) - reply = api_rpc_trans_reply(outbuf, p); + reply = api_rpc_trans_reply(outbuf, p, rdata, rlen); break; + } case 0x53: /* Wait Named Pipe Handle state */ reply = api_WNPHS(outbuf, p, params, tpscnt); -- cgit