mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
r9457: Attempt to fix bug #3010 by handling END_OF_DIRECTORY_OFFSET
consistently.
Jeremy.
(This used to be commit ac8f22a328
)
This commit is contained in:
parent
337db26f16
commit
f069f96a1f
@ -1100,6 +1100,9 @@ const char *ReadDirName(struct smb_Dir *dirp, long *poffset)
|
|||||||
}
|
}
|
||||||
dirp->file_number++;
|
dirp->file_number++;
|
||||||
return n;
|
return n;
|
||||||
|
} else if (*poffset == END_OF_DIRECTORY_OFFSET) {
|
||||||
|
*poffset = dirp->offset = END_OF_DIRECTORY_OFFSET;
|
||||||
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
/* A real offset, seek to it. */
|
/* A real offset, seek to it. */
|
||||||
SeekDir(dirp, *poffset);
|
SeekDir(dirp, *poffset);
|
||||||
@ -1122,7 +1125,7 @@ const char *ReadDirName(struct smb_Dir *dirp, long *poffset)
|
|||||||
dirp->file_number++;
|
dirp->file_number++;
|
||||||
return e->name;
|
return e->name;
|
||||||
}
|
}
|
||||||
dirp->offset = END_OF_DIRECTORY_OFFSET;
|
*poffset = dirp->offset = END_OF_DIRECTORY_OFFSET;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1147,6 +1150,8 @@ void SeekDir(struct smb_Dir *dirp, long offset)
|
|||||||
if (offset != dirp->offset) {
|
if (offset != dirp->offset) {
|
||||||
if (offset == START_OF_DIRECTORY_OFFSET || offset == DOT_DOT_DIRECTORY_OFFSET) {
|
if (offset == START_OF_DIRECTORY_OFFSET || offset == DOT_DOT_DIRECTORY_OFFSET) {
|
||||||
RewindDir(dirp, &offset);
|
RewindDir(dirp, &offset);
|
||||||
|
} else if (offset == END_OF_DIRECTORY_OFFSET) {
|
||||||
|
; /* Don't seek in this case. */
|
||||||
} else {
|
} else {
|
||||||
SMB_VFS_SEEKDIR(dirp->conn, dirp->dir, offset);
|
SMB_VFS_SEEKDIR(dirp->conn, dirp->dir, offset);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user