svn commit: samba r10558 - in branches/SAMBA_3_0/source/smbd: .

jra at samba.org jra at samba.org
Tue Sep 27 20:41:24 GMT 2005


Author: jra
Date: 2005-09-27 20:41:22 +0000 (Tue, 27 Sep 2005)
New Revision: 10558

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

Log:
Fix bug #3010 yet again. Die monster, die !
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/dir.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/dir.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/dir.c	2005-09-27 20:41:04 UTC (rev 10557)
+++ branches/SAMBA_3_0/source/smbd/dir.c	2005-09-27 20:41:22 UTC (rev 10558)
@@ -1148,8 +1148,23 @@
 void SeekDir(struct smb_Dir *dirp, long offset)
 {
 	if (offset != dirp->offset) {
-		if (offset == START_OF_DIRECTORY_OFFSET || offset == DOT_DOT_DIRECTORY_OFFSET) {
+		if (offset == START_OF_DIRECTORY_OFFSET) {
 			RewindDir(dirp, &offset);
+			/* 
+			 * Ok we should really set the file number here
+			 * to 1 to enable ".." to be returned next. Trouble
+			 * is I'm worried about callers using SeekDir(dirp,0)
+			 * as equivalent to RewindDir(). So leave this alone
+			 * for now.
+			 */
+		} else if  (offset == DOT_DOT_DIRECTORY_OFFSET) {
+			RewindDir(dirp, &offset);
+			/*
+			 * Set the file number to 2 - we want to get the first
+			 * real file entry (the one we return after "..")
+			 * on the next ReadDir.
+			 */
+			dirp->file_number = 2;
 		} else if (offset == END_OF_DIRECTORY_OFFSET) {
 			; /* Don't seek in this case. */
 		} else {



More information about the samba-cvs mailing list