From 5afc25eceb0c0e031bbe162617309178f3bcc425 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 11 Jan 2014 14:48:00 -0800 Subject: [PATCH] s3:dir - Introduce a function to map a directory cookie to a 32-bit wire cookie. Make this an identity for now. https://bugzilla.samba.org/show_bug.cgi?id=2662 Signed-off-by: Jeremy Allison Reviewed-by: Andreas Schneider --- source3/smbd/dir.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 38da2ca5479..fb2ad88f752 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -894,6 +894,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. ****************************************************************************/ @@ -908,7 +917,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; -- 2.34.1