smbd: Remove unused "poffset" parameter from dptr_SearchDir()
authorVolker Lendecke <vl@samba.org>
Fri, 9 Jun 2023 07:33:42 +0000 (09:33 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 13 Jun 2023 23:33:39 +0000 (23:33 +0000)
The only caller threw the result away.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dir.c
source3/smbd/proto.h
source3/smbd/smb1_trans2.c

index 66b277fd7d20d6bc0944716e4d2bc7be9b1e3f74..7bf0646a6dbd002c04d598b39f0921db91617d8c 100644 (file)
@@ -531,15 +531,15 @@ ret:
  Search for a file by name.
 ****************************************************************************/
 
-bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset)
+bool dptr_SearchDir(struct dptr_struct *dptr, const char *name)
 {
+       long offset;
        if (!dptr->has_wild && (dptr->dir_hnd->offset == END_OF_DIRECTORY_OFFSET)) {
                /* This is a singleton directory and we're already at the end. */
-               *poffset = END_OF_DIRECTORY_OFFSET;
                return False;
        }
 
-       return SearchDir(dptr->dir_hnd, name, poffset);
+       return SearchDir(dptr->dir_hnd, name, &offset);
 }
 
 struct files_struct *dir_hnd_fetch_fsp(struct smb_Dir *dir_hnd)
index f1364a45e37e3355041b21a204a0adb3daa9965f..48d6aa8af479b39a05064d9d4223abefe4ae9e67 100644 (file)
@@ -200,7 +200,7 @@ int dptr_dnum(struct dptr_struct *dptr);
 bool dptr_get_priv(struct dptr_struct *dptr);
 void dptr_set_priv(struct dptr_struct *dptr);
 bool dptr_case_sensitive(struct dptr_struct *dptr);
-bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset);
+bool dptr_SearchDir(struct dptr_struct *dptr, const char *name);
 struct smb_Dir;
 struct files_struct *dir_hnd_fetch_fsp(struct smb_Dir *dir_hnd);
 files_struct *dptr_fetch_lanman2_fsp(struct smbd_server_connection *sconn,
index af034d255ecd1ffdaeca9414260ac26fdf2a2c61..eab121d691ca5fc806f1ad898f881950ff6a488c 100644 (file)
@@ -1510,7 +1510,6 @@ static void call_trans2findnext(connection_struct *conn,
        if(!continue_bit && resume_name && *resume_name) {
                bool posix_open = (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN);
 
-               long current_pos = 0;
                /*
                 * Remember, name_to_8_3 is called by
                 * get_lanman2_dir_entry(), so the resume name
@@ -1538,8 +1537,7 @@ static void call_trans2findnext(connection_struct *conn,
                 * should already be at the correct place.
                 */
 
-               finished =
-                       !dptr_SearchDir(fsp->dptr, resume_name, &current_pos);
+               finished = !dptr_SearchDir(fsp->dptr, resume_name);
        } /* end if resume_name && !continue_bit */
 
        ask_sharemode = fsp_search_ask_sharemode(fsp);