summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-05 10:37:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:20 -0500
commitb8de67a2f2ef7334a77aa3b71752658c4555191d (patch)
tree43275ca7aa076c8d362bd1ae072dcb21a86e00fd /source3/smbd
parentfbe15d8db9fc06c9ad6565f15da58dbb7027ce35 (diff)
downloadsamba-b8de67a2f2ef7334a77aa3b71752658c4555191d.tar.gz
samba-b8de67a2f2ef7334a77aa3b71752658c4555191d.tar.bz2
samba-b8de67a2f2ef7334a77aa3b71752658c4555191d.zip
r24240: Push down reply_prep_legacy one level inside api_fd_reply
(This used to be commit 0bb95639d6b49b18f2a7f1131f54239355097119)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/ipc.c73
1 files changed, 54 insertions, 19 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index a190a59996..ddc42c408e 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -293,8 +293,6 @@ static void api_fd_reply(connection_struct *conn, uint16 vuid,
smb_np_struct *p = NULL;
int pnum;
int subcommand;
- char *inbuf, *outbuf;
- int size, buflength;
DEBUG(5,("api_fd_reply\n"));
@@ -341,37 +339,74 @@ static void api_fd_reply(connection_struct *conn, uint16 vuid,
DEBUG(10,("api_fd_reply: p:%p max_trans_reply: %d\n", p, p->max_trans_reply));
- if (!reply_prep_legacy(req, &inbuf, &outbuf, &size, &buflength)) {
- reply_nterror(req, NT_STATUS_NO_MEMORY);
- return;
- }
-
switch (subcommand) {
- case TRANSACT_DCERPCCMD:
+ case TRANSACT_DCERPCCMD: {
+
+ char *inbuf, *outbuf;
+ int size, buflength;
+
+ if (!reply_prep_legacy(req, &inbuf, &outbuf, &size,
+ &buflength)) {
+ reply_nterror(req, NT_STATUS_NO_MEMORY);
+ return;
+ }
+
/* dce/rpc command */
reply = write_to_pipe(p, data, tdscnt);
if (reply)
reply = api_rpc_trans_reply(inbuf, outbuf, p);
+
+ if (!reply) {
+ api_no_reply(req);
+ return;
+ }
+ reply_post_legacy(req, -1);
break;
- case TRANSACT_WAITNAMEDPIPEHANDLESTATE:
+ }
+ case TRANSACT_WAITNAMEDPIPEHANDLESTATE: {
+
+ char *inbuf, *outbuf;
+ int size, buflength;
+
+ if (!reply_prep_legacy(req, &inbuf, &outbuf, &size,
+ &buflength)) {
+ reply_nterror(req, NT_STATUS_NO_MEMORY);
+ return;
+ }
+
/* Wait Named Pipe Handle state */
- reply = api_WNPHS(inbuf, outbuf, p, params, tpscnt);
+ if (!api_WNPHS(inbuf, outbuf, p, params, tpscnt)) {
+ api_no_reply(req);
+ return;
+ }
+
+ reply_post_legacy(req, -1);
break;
- case TRANSACT_SETNAMEDPIPEHANDLESTATE:
+ }
+ case TRANSACT_SETNAMEDPIPEHANDLESTATE: {
+
+ char *inbuf, *outbuf;
+ int size, buflength;
+
+ if (!reply_prep_legacy(req, &inbuf, &outbuf, &size,
+ &buflength)) {
+ reply_nterror(req, NT_STATUS_NO_MEMORY);
+ return;
+ }
+
/* Set Named Pipe Handle state */
- reply = api_SNPHS(inbuf, outbuf, p, params, tpscnt);
+ if (!api_SNPHS(inbuf, outbuf, p, params, tpscnt)) {
+ api_no_reply(req);
+ return;
+ }
+
+ reply_post_legacy(req, -1);
break;
+ }
default:
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
return;
}
-
- if (!reply) {
- api_no_reply(req);
- return;
- }
-
- reply_post_legacy(req, -1);
}
/****************************************************************************