svn commit: samba r4191 - in trunk/source/smbd: .

jra at samba.org jra at samba.org
Tue Dec 14 01:11:23 GMT 2004


Author: jra
Date: 2004-12-14 01:11:22 +0000 (Tue, 14 Dec 2004)
New Revision: 4191

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

Log:
When changing length calculations, get them right......
Jeremy.

Modified:
   trunk/source/smbd/process.c
   trunk/source/smbd/reply.c


Changeset:
Modified: trunk/source/smbd/process.c
===================================================================
--- trunk/source/smbd/process.c	2004-12-14 01:11:22 UTC (rev 4190)
+++ trunk/source/smbd/process.c	2004-12-14 01:11:22 UTC (rev 4191)
@@ -1177,7 +1177,7 @@
 	int outsize2;
 	char inbuf_saved[smb_wct];
 	char outbuf_saved[smb_wct];
-	int outsize = smb_len(outbuf);
+	int outsize = smb_len(outbuf) + 4;
 
 	/* maybe its not chained */
 	if (smb_com2 == 0xFF) {

Modified: trunk/source/smbd/reply.c
===================================================================
--- trunk/source/smbd/reply.c	2004-12-14 01:11:22 UTC (rev 4190)
+++ trunk/source/smbd/reply.c	2004-12-14 01:11:22 UTC (rev 4191)
@@ -2112,6 +2112,7 @@
 int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length, int len_outbuf,
 		files_struct *fsp, SMB_OFF_T startpos, size_t smb_maxcnt)
 {
+	int outsize = 0;
 	ssize_t nread = -1;
 	char *data = smb_buf(outbuf);
 
@@ -2197,7 +2198,7 @@
 		return(UNIXERROR(ERRDOS,ERRnoaccess));
 	}
 
-	set_message(outbuf,12,nread,False);
+	outsize = set_message(outbuf,12,nread,False);
 	SSVAL(outbuf,smb_vwv2,0xFFFF); /* Remaining - must be -1. */
 	SSVAL(outbuf,smb_vwv5,nread);
 	SSVAL(outbuf,smb_vwv6,smb_offset(data,outbuf));
@@ -2207,7 +2208,7 @@
 	DEBUG( 3, ( "send_file_readX fnum=%d max=%d nread=%d\n",
 		fsp->fnum, (int)smb_maxcnt, (int)nread ) );
 
-	return nread;
+	return outsize;
 }
 
 /****************************************************************************



More information about the samba-cvs mailing list