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

vlendec at samba.org vlendec at samba.org
Sun Aug 5 08:47:11 GMT 2007


Author: vlendec
Date: 2007-08-05 08:47:09 +0000 (Sun, 05 Aug 2007)
New Revision: 24231

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

Log:
Push allocating InBuffer/OutBuffer into reply_transs
Modified:
   branches/SAMBA_3_2/source/smbd/ipc.c
   branches/SAMBA_3_2/source/smbd/process.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/ipc.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/ipc.c	2007-08-05 08:31:41 UTC (rev 24230)
+++ branches/SAMBA_3_2/source/smbd/ipc.c	2007-08-05 08:47:09 UTC (rev 24231)
@@ -703,21 +703,29 @@
  Reply to a secondary SMBtrans.
  ****************************************************************************/
 
-int reply_transs(connection_struct *conn, char *inbuf,char *outbuf,
-		 int size, int bufsize)
+void reply_transs(connection_struct *conn, struct smb_request *req)
 {
 	int outsize = 0;
 	unsigned int pcnt,poff,dcnt,doff,pdisp,ddisp;
 	struct trans_state *state;
 	NTSTATUS result;
+	char *inbuf, *outbuf;
+	int size, bufsize;
 
 	START_PROFILE(SMBtranss);
 
+	if (!reply_prep_legacy(req, &inbuf, &outbuf, &size, &bufsize)) {
+		reply_nterror(req, NT_STATUS_NO_MEMORY);
+		END_PROFILE(SMBtranss);
+		return;
+	}
+
 	show_msg(inbuf);
 
-	if (SVAL(inbuf, smb_wct) < 10) {
+	if (req->wct < 10) {
+		reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
 		END_PROFILE(SMBtranss);
-		return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+		return;
 	}
 
 	for (state = conn->pending_trans; state != NULL;
@@ -728,8 +736,9 @@
 	}
 
 	if ((state == NULL) || (state->cmd != SMBtrans)) {
+		reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
 		END_PROFILE(SMBtranss);
-		return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+		return;
 	}
 
 	/* Revise total_params and total_data in case they have changed
@@ -792,7 +801,7 @@
 	if ((state->received_param < state->total_param) ||
 	    (state->received_data < state->total_data)) {
 		END_PROFILE(SMBtranss);
-		return -1;
+		return;
 	}
 
 	/* construct_reply_common has done us the favor to pre-fill the
@@ -808,12 +817,13 @@
 	TALLOC_FREE(state);
 
 	if ((outsize == 0) || !NT_STATUS_IS_OK(result)) {
+		reply_doserror(req, ERRSRV, ERRnosupport);
 		END_PROFILE(SMBtranss);
-		return(ERROR_DOS(ERRSRV,ERRnosupport));
+		return;
 	}
 	
 	END_PROFILE(SMBtranss);
-	return(outsize);
+	return;
 
   bad_param:
 
@@ -822,6 +832,7 @@
 	SAFE_FREE(state->data);
 	SAFE_FREE(state->param);
 	TALLOC_FREE(state);
+	reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
 	END_PROFILE(SMBtranss);
-	return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+	return;
 }

Modified: branches/SAMBA_3_2/source/smbd/process.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/process.c	2007-08-05 08:31:41 UTC (rev 24230)
+++ branches/SAMBA_3_2/source/smbd/process.c	2007-08-05 08:47:09 UTC (rev 24231)
@@ -726,7 +726,7 @@
 /* 0x23 */ { "SMBgetattrE",reply_getattrE,NULL,AS_USER },
 /* 0x24 */ { "SMBlockingX",reply_lockingX,NULL,AS_USER },
 /* 0x25 */ { "SMBtrans",NULL,reply_trans,AS_USER | CAN_IPC },
-/* 0x26 */ { "SMBtranss",reply_transs,NULL,AS_USER | CAN_IPC},
+/* 0x26 */ { "SMBtranss",NULL,reply_transs,AS_USER | CAN_IPC},
 /* 0x27 */ { "SMBioctl",reply_ioctl,NULL,0},
 /* 0x28 */ { "SMBioctls",NULL, NULL,AS_USER},
 /* 0x29 */ { "SMBcopy",reply_copy,NULL,AS_USER | NEED_WRITE },



More information about the samba-cvs mailing list