svn commit: samba r24240 - in branches/SAMBA_3_2/source/smbd: .

vlendec at samba.org vlendec at samba.org
Sun Aug 5 10:37:10 GMT 2007


Author: vlendec
Date: 2007-08-05 10:37:08 +0000 (Sun, 05 Aug 2007)
New Revision: 24240

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24240

Log:
Push down reply_prep_legacy one level inside api_fd_reply
Modified:
   branches/SAMBA_3_2/source/smbd/ipc.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/ipc.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/ipc.c	2007-08-05 10:28:12 UTC (rev 24239)
+++ branches/SAMBA_3_2/source/smbd/ipc.c	2007-08-05 10:37:08 UTC (rev 24240)
@@ -293,8 +293,6 @@
 	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 @@
 
 	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: {
 
-	switch (subcommand) {
-	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);
 }
 
 /****************************************************************************



More information about the samba-cvs mailing list