]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: pass dirfsp instead of conn and dptr to smbd_dirptr_lanman2_entry() and get_lan...
authorRalph Boehme <slow@samba.org>
Sun, 25 May 2025 18:04:53 +0000 (20:04 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 7 Jul 2025 16:47:35 +0000 (16:47 +0000)
No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/globals.h
source3/smbd/smb1_trans2.c
source3/smbd/smb2_query_directory.c
source3/smbd/smb2_trans2.c

index c74762248c1b0ab5ae3a1ef39aa468f01acbdeed..e518c710cdaa40f7f114e8e5a78ca93cfdcc894f 100644 (file)
@@ -162,8 +162,7 @@ NTSTATUS smbd_do_qfsinfo(struct smbXsrv_connection *xconn,
                         int *ret_data_len);
 
 NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
-                              connection_struct *conn,
-                              struct dptr_struct *dirptr,
+                              struct files_struct *dirfsp,
                               uint16_t flags2,
                               const char *path_mask,
                               uint32_t dirtype,
index 643c05dd77ed25c8128f306eeaf43b397d6dcee7..568a5611223aacc2bb409dfd003a6c4593fed235 100644 (file)
@@ -769,8 +769,7 @@ static void call_trans2open(connection_struct *conn,
 }
 
 static NTSTATUS get_lanman2_dir_entry(TALLOC_CTX *ctx,
-                               connection_struct *conn,
-                               struct dptr_struct *dirptr,
+                               struct files_struct *dirfsp,
                                uint16_t flags2,
                                const char *path_mask,
                                uint32_t dirtype,
@@ -792,7 +791,7 @@ static NTSTATUS get_lanman2_dir_entry(TALLOC_CTX *ctx,
                align = 1;
        }
 
-       return smbd_dirptr_lanman2_entry(ctx, conn, dirptr, flags2,
+       return smbd_dirptr_lanman2_entry(ctx, dirfsp, flags2,
                                         path_mask, dirtype, info_level,
                                         requires_resume_key, dont_descend,
                                         true, align, do_pad,
@@ -1108,8 +1107,7 @@ static void call_trans2findfirst(connection_struct *conn,
        for (i=0;(i<maxentries) && !finished && !out_of_space;i++) {
 
                ntstatus = get_lanman2_dir_entry(talloc_tos(),
-                                                conn,
-                                                fsp->dptr,
+                                                fsp,
                                                 req->flags2,
                                                 mask,
                                                 dirtype,
@@ -1568,8 +1566,7 @@ static void call_trans2findnext(connection_struct *conn,
        for (i=0;(i<(int)maxentries) && !finished && !out_of_space ;i++) {
 
                ntstatus = get_lanman2_dir_entry(ctx,
-                                                conn,
-                                                fsp->dptr,
+                                                fsp,
                                                 req->flags2,
                                                 mask,
                                                 dirtype,
index ba8b690e1d73a23958868cd0e17e77c8b4bc531d..0e66705425ad24a47ee20d8af7e47835874311fd 100644 (file)
@@ -534,8 +534,7 @@ static bool smb2_query_directory_next_entry(struct tevent_req *req)
        SMB_ASSERT(space_remaining >= 0);
 
        status = smbd_dirptr_lanman2_entry(state,
-                                          state->dirfsp->conn,
-                                          state->dirfsp->dptr,
+                                          state->dirfsp,
                                           state->smbreq->flags2,
                                           state->in_file_name,
                                           state->dirtype,
index 3483a413335bac5677e7b45f6fc50d26c73ec7fb..8c3076de603427817cd4c89e999a09ce2176c874 100644 (file)
@@ -1758,8 +1758,7 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx,
 }
 
 NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
-                              connection_struct *conn,
-                              struct dptr_struct *dirptr,
+                              struct files_struct *dirfsp,
                               uint16_t flags2,
                               const char *path_mask,
                               uint32_t dirtype,
@@ -1778,6 +1777,8 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
                               struct ea_list *name_list,
                               struct file_id *file_id)
 {
+       struct connection_struct *conn = dirfsp->conn;
+       struct dptr_struct *dirptr = dirfsp->dptr;
        const char *p;
        const char *mask = NULL;
        uint32_t mode = 0;