svn commit: samba r7616 - in trunk/source/smbd: .
jra at samba.org
jra at samba.org
Wed Jun 15 18:37:30 GMT 2005
Author: jra
Date: 2005-06-15 18:37:29 +0000 (Wed, 15 Jun 2005)
New Revision: 7616
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7616
Log:
Fix for bug #2801 - delete veto files was broken with the new
large directory code.
Jeremy.
Modified:
trunk/source/smbd/dir.c
trunk/source/smbd/reply.c
Changeset:
Modified: trunk/source/smbd/dir.c
===================================================================
--- trunk/source/smbd/dir.c 2005-06-15 17:15:01 UTC (rev 7615)
+++ trunk/source/smbd/dir.c 2005-06-15 18:37:29 UTC (rev 7616)
@@ -1111,13 +1111,29 @@
}
/*******************************************************************
+ Rewind to the start.
+********************************************************************/
+
+void RewindDir(struct smb_Dir *dirp, long *poffset)
+{
+ SMB_VFS_REWINDDIR(dirp->conn, dirp->dir);
+ dirp->file_number = 0;
+ dirp->offset = 0;
+ *poffset = 0;
+}
+
+/*******************************************************************
Seek a dir.
********************************************************************/
void SeekDir(struct smb_Dir *dirp, long offset)
{
if (offset != dirp->offset) {
- SMB_VFS_SEEKDIR(dirp->conn, dirp->dir, offset);
+ if (offset == 0) {
+ RewindDir(dirp, &offset);
+ } else {
+ SMB_VFS_SEEKDIR(dirp->conn, dirp->dir, offset);
+ }
dirp->offset = offset;
}
}
Modified: trunk/source/smbd/reply.c
===================================================================
--- trunk/source/smbd/reply.c 2005-06-15 17:15:01 UTC (rev 7615)
+++ trunk/source/smbd/reply.c 2005-06-15 18:37:29 UTC (rev 7616)
@@ -3761,7 +3761,7 @@
struct smb_Dir *dir_hnd = OpenDir(conn, directory);
if(dir_hnd != NULL) {
- long dirpos = TellDir(dir_hnd);
+ long dirpos = 0;
while ((dname = ReadDirName(dir_hnd,&dirpos))) {
if((strcmp(dname, ".") == 0) || (strcmp(dname, "..")==0))
continue;
@@ -3774,7 +3774,7 @@
}
if(all_veto_files) {
- SeekDir(dir_hnd,dirpos);
+ RewindDir(dir_hnd);
while ((dname = ReadDirName(dir_hnd,&dirpos))) {
pstring fullname;
More information about the samba-cvs
mailing list