svn commit: samba r5701 - in trunk/source/libsmb: .

jra at samba.org jra at samba.org
Wed Mar 9 00:06:03 GMT 2005


Author: jra
Date: 2005-03-09 00:06:03 +0000 (Wed, 09 Mar 2005)
New Revision: 5701

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

Log:
Fix bug #2271. Correctly pull out and use resume names in a
directory listing (we were incorrectly understanding what was
returned in the "last name" entry).
Jeremy.

Modified:
   trunk/source/libsmb/clilist.c


Changeset:
Modified: trunk/source/libsmb/clilist.c
===================================================================
--- trunk/source/libsmb/clilist.c	2005-03-08 23:03:38 UTC (rev 5700)
+++ trunk/source/libsmb/clilist.c	2005-03-09 00:06:03 UTC (rev 5701)
@@ -268,24 +268,6 @@
 		p = rdata;
 
 		/* we might need the lastname for continuations */
-		if (ff_lastname > 0) {
-			switch(info_level) {
-				case 260:
-					clistr_pull(cli, mask, p+ff_lastname,
-						    sizeof(mask), 
-						    data_len-ff_lastname,
-						    STR_TERMINATE);
-					break;
-				case 1:
-					clistr_pull(cli, mask, p+ff_lastname+1,
-						    sizeof(mask), 
-						    -1,
-						    STR_TERMINATE);
-					break;
-				}
-		} else {
-			pstrcpy(mask,"");
-		}
  
 		/* and add them to the dirlist pool */
 		tdl = SMB_REALLOC(dirlist,dirlist_len + data_len);
@@ -299,10 +281,18 @@
 
 		/* put in a length for the last entry, to ensure we can chain entries 
 		   into the next packet */
-		for (p2=p,i=0;i<(ff_searchcount-1);i++)
-			p2 += interpret_long_filename(cli,info_level,p2,NULL);
+		for (p2=p,i=0;i<(ff_searchcount-1);i++) {
+			p2 += interpret_long_filename(cli,info_level,p2,&finfo);
+		}
 		SSVAL(p2,0,data_len - PTR_DIFF(p2,p));
 
+		/* we might need the lastname for continuations */
+		if (ff_lastname > 0) {
+			pstrcpy(mask, finfo.name);
+		} else {
+			pstrcpy(mask,"");
+		}
+
 		/* grab the data for later use */
 		memcpy(dirlist+dirlist_len,p,data_len);
 		dirlist_len += data_len;



More information about the samba-cvs mailing list