From 431a28a3151f6cb8f9e1de769da11a22c379d9d8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 1 May 2005 09:30:18 +0000 Subject: r6548: Fix bug #2622 - remove DPTR_MASK as it makes no sense. Jeremy. (This used to be commit 927681c8c4458c77de2622557f1465fd5ca1c28b) --- source3/include/smb_macros.h | 8 +------- source3/smbd/dir.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'source3') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 6d1e382bb8..37e5a897cb 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -224,17 +224,11 @@ true if two IP addresses are equal #define reg_get_subkey(full_keyname, key_name, subkey_name) \ split_at_last_component(full_keyname, key_name, '\\', subkey_name) -/**************************************************************************** - Used by dptr_zero. -****************************************************************************/ - -#define DPTR_MASK ((uint32)(((uint32)1)<<31)) - /**************************************************************************** Return True if the offset is at zero. ****************************************************************************/ -#define dptr_zero(buf) ((IVAL(buf,1)&~DPTR_MASK) == 0) +#define dptr_zero(buf) (IVAL(buf,1) == 0) /******************************************************************* copy an IP address from one buffer to another diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 5ebbfe478f..3c93c188ff 100644 --- a/source3/smbd/dir.c +++ b/source3/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); } -- cgit