summaryrefslogtreecommitdiff
path: root/source3
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
commit22f603ac567f369b544267c5e891d282dd3e2dfa (patch)
treee21767ee9b35695d29fe4feb9673cbc58b0146c1 /source3
parente403d11fcb2478e2675e76d0cc9994e6dde4ceed (diff)
downloadsamba-22f603ac567f369b544267c5e891d282dd3e2dfa.tar.gz
samba-22f603ac567f369b544267c5e891d282dd3e2dfa.tar.bz2
samba-22f603ac567f369b544267c5e891d282dd3e2dfa.zip
r10558: Fix bug #3010 yet again. Die monster, die !
Jeremy. (This used to be commit dba56e8d23dc10a31f0f700b02c8776bdc8f57c1)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/dir.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 02e15d222a..70a3b81ad6 100644
--- a/source3/smbd/dir.c
+++ b/source3/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 {