s3: smbd: Remove dptr_fetch() - replace internals with dptr_fetch_fsp().
authorJeremy Allison <jra@samba.org>
Wed, 17 Jul 2019 20:16:37 +0000 (13:16 -0700)
committerRalph Boehme <slow@samba.org>
Tue, 6 Aug 2019 14:23:34 +0000 (14:23 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/dir.c
source3/smbd/proto.h

index 1cecef1997b8a0d950e99bf50a1a9753827fdf69..478ba5a98351d91dad68e957071015752a0dfaf9 100644 (file)
@@ -793,10 +793,11 @@ static long map_wire_to_dir_offset(struct dptr_struct *dptr, uint32_t wire_offse
 }
 
 /****************************************************************************
- Fetch the dir ptr and seek it given the 5 byte server field.
+ Return the associated fsp and seek the dir_hnd on it it given the 5 byte
+ server field.
 ****************************************************************************/
 
-struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
+files_struct *dptr_fetch_fsp(struct smbd_server_connection *sconn,
                               char *buf, int *num)
 {
        unsigned int key = *(unsigned char *)buf;
@@ -804,7 +805,7 @@ struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
        uint32_t wire_offset;
        long seekoff;
 
-       if (!dptr) {
+       if (dptr == NULL) {
                DEBUG(3,("fetched null dirptr %d\n",key));
                return(NULL);
        }
@@ -814,22 +815,6 @@ struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
        SeekDir(dptr->dir_hnd,seekoff);
        DEBUG(3,("fetching dirptr %d for path %s at offset %d\n",
                key, dptr->smb_dname->base_name, (int)seekoff));
-       return(dptr);
-}
-
-/****************************************************************************
- Return the associated fsp and seek the dir_hnd on it it given the 5 byte
- server field.
-****************************************************************************/
-
-files_struct *dptr_fetch_fsp(struct smbd_server_connection *sconn,
-                              char *buf, int *num)
-{
-       struct dptr_struct *dptr = dptr_fetch(sconn, buf, num);
-
-       if (dptr == NULL) {
-               return NULL;
-       }
        return dptr->dir_hnd->fsp;
 }
 
index 66b756a9c2e0cd32b3ce0516237da1dc92a9651b..9b087fa6c9463e2b4d81ea2a9c504e04c65cfe3d 100644 (file)
@@ -207,8 +207,6 @@ void dptr_set_priv(struct dptr_struct *dptr);
 bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst);
 bool dptr_fill(struct smbd_server_connection *sconn,
               char *buf1,unsigned int key);
-struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
-                              char *buf,int *num);
 files_struct *dptr_fetch_fsp(struct smbd_server_connection *sconn,
                               char *buf,int *num);
 struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn,