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

vlendec at samba.org vlendec at samba.org
Mon Jul 23 19:46:49 GMT 2007


Author: vlendec
Date: 2007-07-23 19:46:48 +0000 (Mon, 23 Jul 2007)
New Revision: 24009

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

Log:
Revert to the 3.0.25 logic for parsing the client's protocols. hpisgr8
with gcc still gives timeouts which worry me.

Volker

Modified:
   branches/SAMBA_3_2/source/smbd/negprot.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/negprot.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/negprot.c	2007-07-23 19:09:19 UTC (rev 24008)
+++ branches/SAMBA_3_2/source/smbd/negprot.c	2007-07-23 19:46:48 UTC (rev 24009)
@@ -511,6 +511,7 @@
 	int choice= -1;
 	int protocol;
 	char *p;
+	int bcc = SVAL(smb_buf(req->inbuf),-2);
 	int arch = ARCH_ALL;
 	int num_cliprotos;
 	char **cliprotos;
@@ -533,24 +534,15 @@
 		return;
 	}
 
-	p = smb_buf(req->inbuf);
+	p = smb_buf(req->inbuf) + 1;
 
 	num_cliprotos = 0;
 	cliprotos = NULL;
 
-	while (smb_bufrem(req->inbuf, p) > 0) {
+	while (p < (smb_buf(req->inbuf) + bcc)) { 
+
 		char **tmp;
 
-		if (p[0] != 0x02) {
-			DEBUG(3, ("Invalid string specifier %x, expected "
-				  "0x02\n", (int)p[0]));
-			reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
-			END_PROFILE(SMBnegprot);
-			return;
-		}
-
-		p += 1; /* Skip the "0x02" */
-
 		tmp = TALLOC_REALLOC_ARRAY(tmp_talloc_ctx(), cliprotos, char *,
 					   num_cliprotos+1);
 		if (tmp == NULL) {
@@ -576,7 +568,7 @@
 			  cliprotos[num_cliprotos]));
 
 		num_cliprotos += 1;
-		p += strlen(p) + 1;
+		p += strlen(p) + 2;
 	}
 
 	for (i=0; i<num_cliprotos; i++) {



More information about the samba-cvs mailing list