From: Ralph Boehme Date: Sun, 25 May 2025 18:04:53 +0000 (+0200) Subject: smbd: pass dirfsp instead of conn and dptr to smbd_dirptr_lanman2_entry() and get_lan... X-Git-Tag: tdb-1.4.14~134 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e5ff201592eec86b22ccaa977f3efd3c0e5f9053;p=thirdparty%2Fsamba.git smbd: pass dirfsp instead of conn and dptr to smbd_dirptr_lanman2_entry() and get_lanman2_dir_entry() No change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15862 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index c74762248c1..e518c710cda 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -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, diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c index 643c05dd77e..568a5611223 100644 --- a/source3/smbd/smb1_trans2.c +++ b/source3/smbd/smb1_trans2.c @@ -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;(idptr, + 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, diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c index ba8b690e1d7..0e66705425a 100644 --- a/source3/smbd/smb2_query_directory.c +++ b/source3/smbd/smb2_query_directory.c @@ -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, diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index 3483a413335..8c3076de603 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -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;