svn commit: samba r6547 - in trunk/source: include smbd

jra at samba.org jra at samba.org
Sun May 1 09:30:18 GMT 2005


Author: jra
Date: 2005-05-01 09:30:17 +0000 (Sun, 01 May 2005)
New Revision: 6547

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6547

Log:
Fix bug #2622 - remove DPTR_MASK as it makes no sense.
Jeremy.

Modified:
   trunk/source/include/smb_macros.h
   trunk/source/smbd/dir.c


Changeset:
Modified: trunk/source/include/smb_macros.h
===================================================================
--- trunk/source/include/smb_macros.h	2005-05-01 09:04:51 UTC (rev 6546)
+++ trunk/source/include/smb_macros.h	2005-05-01 09:30:17 UTC (rev 6547)
@@ -221,16 +221,10 @@
 	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

Modified: trunk/source/smbd/dir.c
===================================================================
--- trunk/source/smbd/dir.c	2005-05-01 09:04:51 UTC (rev 6546)
+++ trunk/source/smbd/dir.c	2005-05-01 09:30:17 UTC (rev 6547)
@@ -624,11 +624,11 @@
 		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 @@
 	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);
 }
 



More information about the samba-cvs mailing list