summaryrefslogtreecommitdiffstats
path: root/source/smbd/dir.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-05-01 09:30:18 +0000
committerJeremy Allison <jra@samba.org>2005-05-01 09:30:18 +0000
commit483b623ab1ea10a80423bc2d098b615f458f5e83 (patch)
treec95389bd5c333af0aab76bff5c7ffc668dfcb109 /source/smbd/dir.c
parentc8768946bcc882a5b443639713d3ca0b51dddf94 (diff)
downloadsamba-483b623ab1ea10a80423bc2d098b615f458f5e83.tar.gz
samba-483b623ab1ea10a80423bc2d098b615f458f5e83.tar.xz
samba-483b623ab1ea10a80423bc2d098b615f458f5e83.zip
r6548: Fix bug #2622 - remove DPTR_MASK as it makes no sense.
Jeremy.
Diffstat (limited to 'source/smbd/dir.c')
-rw-r--r--source/smbd/dir.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/smbd/dir.c b/source/smbd/dir.c
index 5ebbfe478fc..3c93c188ff3 100644
--- a/source/smbd/dir.c
+++ b/source/smbd/dir.c
@@ -624,11 +624,11 @@ BOOL dptr_fill(char *buf1,unsigned int key)
DEBUG(1,("filling null dirptr %d\n",key));
return(False);
}
- offset = TellDir(dptr->dir_hnd);
+ offset = (uint32)TellDir(dptr->dir_hnd);
DEBUG(6,("fill on key %u dirptr 0x%lx now at %d\n",key,
(long)dptr->dir_hnd,(int)offset));
buf[0] = key;
- SIVAL(buf,1,offset | DPTR_MASK);
+ SIVAL(buf,1,offset);
return(True);
}
@@ -641,16 +641,22 @@ struct dptr_struct *dptr_fetch(char *buf,int *num)
unsigned int key = *(unsigned char *)buf;
struct dptr_struct *dptr = dptr_get(key, False);
uint32 offset;
+ long seekoff;
if (!dptr) {
DEBUG(3,("fetched null dirptr %d\n",key));
return(NULL);
}
*num = key;
- offset = IVAL(buf,1)&~DPTR_MASK;
- SeekDir(dptr->dir_hnd,(long)offset);
+ offset = IVAL(buf,1);
+ if (offset == (uint32)-1) {
+ seekoff = -1;
+ } else {
+ seekoff = (long)offset;
+ }
+ SeekDir(dptr->dir_hnd,seekoff);
DEBUG(3,("fetching dirptr %d for path %s at offset %d\n",
- key,dptr_path(key),offset));
+ key,dptr_path(key),(int)seekoff));
return(dptr);
}