summaryrefslogtreecommitdiff
path: root/source/smbd/dir.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-09-27 20:41:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:04:47 -0500
commitdba56e8d23dc10a31f0f700b02c8776bdc8f57c1 (patch)
tree9b2f6631f596ca8cfaaa58dbc2c2fb258343ee35 /source/smbd/dir.c
parent24b43af642c9d41c14b9ad64704e13cc9150378d (diff)
downloadsamba-dba56e8d23dc10a31f0f700b02c8776bdc8f57c1.tar.gz
r10558: Fix bug #3010 yet again. Die monster, die !
Jeremy.
Diffstat (limited to 'source/smbd/dir.c')
-rw-r--r--source/smbd/dir.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/smbd/dir.c b/source/smbd/dir.c
index 02e15d222a9..70a3b81ad69 100644
--- a/source/smbd/dir.c
+++ b/source/smbd/dir.c
@@ -1148,8 +1148,23 @@ void RewindDir(struct smb_Dir *dirp, long *poffset)
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 {