summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-08-21 21:12:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:01:11 -0500
commitf069f96a1fd96f760597bdfd04968bd6ab2ff5b6 (patch)
treeb1af1e055f4748b001c5a35704f4a4158cf90609 /source3
parent337db26f163317f70cf9e00b8aaf26373e4eb366 (diff)
downloadsamba-f069f96a1fd96f760597bdfd04968bd6ab2ff5b6.tar.gz
samba-f069f96a1fd96f760597bdfd04968bd6ab2ff5b6.tar.bz2
samba-f069f96a1fd96f760597bdfd04968bd6ab2ff5b6.zip
r9457: Attempt to fix bug #3010 by handling END_OF_DIRECTORY_OFFSET
consistently. Jeremy. (This used to be commit ac8f22a328d878f064277638d63446bf68b68dfd)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/dir.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 159ce37236..f722bedecb 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1100,6 +1100,9 @@ const char *ReadDirName(struct smb_Dir *dirp, long *poffset)
}
dirp->file_number++;
return n;
+ } else if (*poffset == END_OF_DIRECTORY_OFFSET) {
+ *poffset = dirp->offset = END_OF_DIRECTORY_OFFSET;
+ return NULL;
} else {
/* A real offset, seek to it. */
SeekDir(dirp, *poffset);
@@ -1122,7 +1125,7 @@ const char *ReadDirName(struct smb_Dir *dirp, long *poffset)
dirp->file_number++;
return e->name;
}
- dirp->offset = END_OF_DIRECTORY_OFFSET;
+ *poffset = dirp->offset = END_OF_DIRECTORY_OFFSET;
return NULL;
}
@@ -1147,6 +1150,8 @@ void SeekDir(struct smb_Dir *dirp, long offset)
if (offset != dirp->offset) {
if (offset == START_OF_DIRECTORY_OFFSET || offset == DOT_DOT_DIRECTORY_OFFSET) {
RewindDir(dirp, &offset);
+ } else if (offset == END_OF_DIRECTORY_OFFSET) {
+ ; /* Don't seek in this case. */
} else {
SMB_VFS_SEEKDIR(dirp->conn, dirp->dir, offset);
}