s3:dir - Introduce a function to map a directory cookie to a 32-bit wire cookie.
authorJeremy Allison <jra@samba.org>
Sat, 11 Jan 2014 22:48:00 +0000 (14:48 -0800)
committerKarolin Seeger <kseeger@samba.org>
Fri, 17 Jan 2014 08:19:21 +0000 (09:19 +0100)
Make this an identity for now.

https://bugzilla.samba.org/show_bug.cgi?id=2662

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 5afc25eceb0c0e031bbe162617309178f3bcc425)

source3/smbd/dir.c

index 6665bb310f0c33c406702bbe72a10573dfc1d647..db6e0e7bc75373ff401dc2a7e03c9384efa6d737 100644 (file)
@@ -903,6 +903,15 @@ void dptr_init_search_op(struct dptr_struct *dptr)
        SMB_VFS_INIT_SEARCH_OP(dptr->conn, dptr->dir_hnd->dir);
 }
 
+/****************************************************************************
+ Map a native directory offset to a 32-bit cookie.
+****************************************************************************/
+
+static uint32_t map_dir_offset_to_wire(struct dptr_struct *dptr, long offset)
+{
+       return (uint32_t)offset;
+}
+
 /****************************************************************************
  Fill the 5 byte server reserved dptr field.
 ****************************************************************************/
@@ -917,7 +926,7 @@ bool dptr_fill(struct smbd_server_connection *sconn,
                DEBUG(1,("filling null dirptr %d\n",key));
                return(False);
        }
-       wire_offset = (uint32_t)TellDir(dptr->dir_hnd);
+       wire_offset = map_dir_offset_to_wire(dptr,TellDir(dptr->dir_hnd));
        DEBUG(6,("fill on key %u dirptr 0x%lx now at %d\n",key,
                (long)dptr->dir_hnd,(int)wire_offset));
        buf[0] = key;