From fcc4efd1ea637c810eed8444080b87d7f92c837a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 11 Dec 2003 09:07:45 +0000 Subject: the next step in the dcerpc server code. Added the link between the IPC IO routines and the dcerpc endpoint servers. (This used to be commit 4929c53bc8dddda8a763fdfbcf81a79776d01113) --- source4/smbd/reply.c | 18 ----------------- source4/smbd/trans2.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 49 insertions(+), 22 deletions(-) (limited to 'source4/smbd') diff --git a/source4/smbd/reply.c b/source4/smbd/reply.c index 759ec1ef05..ce203cbf93 100644 --- a/source4/smbd/reply.c +++ b/source4/smbd/reply.c @@ -2168,24 +2168,6 @@ void reply_ulogoffX(struct request_context *req) } -/**************************************************************************** - Reply to an SMBtrans request -****************************************************************************/ -void reply_trans(struct request_context *req) -{ - req_reply_error(req, NT_STATUS_FOOBAR); -} - - -/**************************************************************************** - Reply to an SMBtranss2 request -****************************************************************************/ -void reply_transs2(struct request_context *req) -{ - req_reply_error(req, NT_STATUS_FOOBAR); -} - - /**************************************************************************** Reply to an SMBfindclose request ****************************************************************************/ diff --git a/source4/smbd/trans2.c b/source4/smbd/trans2.c index 0975f77eed..3115a330e5 100644 --- a/source4/smbd/trans2.c +++ b/source4/smbd/trans2.c @@ -1214,10 +1214,20 @@ static NTSTATUS trans2_backend(struct request_context *req, struct smb_trans2 *t } +/* + backend for trans requests +*/ +static NTSTATUS trans_backend(struct request_context *req, struct smb_trans2 *trans) +{ + + return NT_STATUS_NOT_IMPLEMENTED; +} + + /**************************************************************************** - Reply to an SMBtrans2 request + Reply to an SMBtrans or SMBtrans2 request ****************************************************************************/ -void reply_trans2(struct request_context *req) +void reply_trans_generic(struct request_context *req, uint8 command) { struct smb_trans2 trans; int i; @@ -1262,6 +1272,10 @@ void reply_trans2(struct request_context *req) trans.in.setup[i] = SVAL(req->in.vwv, VWV(14+i)); } + if (command == SMBtrans) { + req_pull_string(req, &trans.in.trans_name, req->in.data, -1, STR_TERMINATE); + } + if (!req_pull_blob(req, req->in.hdr + param_ofs, param_count, &trans.in.params) || !req_pull_blob(req, req->in.hdr + data_ofs, data_count, &trans.in.data)) { req_reply_error(req, NT_STATUS_FOOBAR); @@ -1271,12 +1285,16 @@ void reply_trans2(struct request_context *req) /* is it a partial request? if so, then send a 'send more' message */ if (param_total > param_count || data_total > data_count) { - DEBUG(0,("REWRITE: not handling partial trans2 requests!\n")); + DEBUG(0,("REWRITE: not handling partial trans requests!\n")); return; } /* its a full request, give it to the backend */ - status = trans2_backend(req, &trans); + if (command == SMBtrans) { + status = trans_backend(req, &trans); + } else { + status = trans2_backend(req, &trans); + } if (!NT_STATUS_IS_OK(status)) { req_reply_error(req, status); @@ -1353,3 +1371,30 @@ void reply_trans2(struct request_context *req) req_send_reply(req); } while (params_left != 0 || data_left != 0); } + + +/**************************************************************************** + Reply to an SMBtrans2 +****************************************************************************/ +void reply_trans2(struct request_context *req) +{ + reply_trans_generic(req, SMBtrans2); +} + +/**************************************************************************** + Reply to an SMBtrans +****************************************************************************/ +void reply_trans(struct request_context *req) +{ + reply_trans_generic(req, SMBtrans); +} + +/**************************************************************************** + Reply to an SMBtranss2 request +****************************************************************************/ +void reply_transs2(struct request_context *req) +{ + req_reply_error(req, NT_STATUS_FOOBAR); +} + + -- cgit