mirror of
https://github.com/samba-team/samba.git
synced 2024-12-31 17:18:04 +03:00
r7617: Fix for bug #2801 - delete veto files was broken with the new
large directory code. Jeremy.
This commit is contained in:
parent
c98e17446a
commit
f397cc08b5
@ -1110,6 +1110,18 @@ const char *ReadDirName(struct smb_Dir *dirp, long *poffset)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
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.
|
||||
********************************************************************/
|
||||
@ -1117,7 +1129,11 @@ const char *ReadDirName(struct smb_Dir *dirp, long *poffset)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -3768,7 +3768,7 @@ BOOL rmdir_internals(connection_struct *conn, char *directory)
|
||||
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;
|
||||
@ -3781,7 +3781,7 @@ BOOL rmdir_internals(connection_struct *conn, char *directory)
|
||||
}
|
||||
|
||||
if(all_veto_files) {
|
||||
SeekDir(dir_hnd,dirpos);
|
||||
RewindDir(dir_hnd);
|
||||
while ((dname = ReadDirName(dir_hnd,&dirpos))) {
|
||||
pstring fullname;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user