The Samba-Bugzilla – Attachment 18647 Details for
Bug 15862
SMB3 POSIX Extensions mangles Windows illegal characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP patch
bug15862-wip.patch (text/plain), 4.85 KB, created by
Ralph Böhme
on 2025-05-25 10:12:36 UTC
(
hide
)
Description:
WIP patch
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2025-05-25 10:12:36 UTC
Size:
4.85 KB
patch
obsolete
>From 3d3ba270ad84adf61d6858f9586c44abcc6488cc Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Sun, 25 May 2025 09:06:44 +0200 >Subject: [PATCH] WIP > >--- > source3/smbd/globals.h | 3 +-- > source3/smbd/smb1_trans2.c | 11 ++++------- > source3/smbd/smb2_query_directory.c | 3 +-- > source3/smbd/smb2_trans2.c | 15 +++++++++++---- > 4 files changed, 17 insertions(+), 15 deletions(-) > >diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h >index fc5184961c6a..53456c7aca52 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 *dirsp, > 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 643c05dd77ed..568a5611223a 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;(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, >diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c >index ba8b690e1d73..0e66705425ad 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 0370a8332cd5..59cb04cf09a6 100644 >--- a/source3/smbd/smb2_trans2.c >+++ b/source3/smbd/smb2_trans2.c >@@ -920,6 +920,7 @@ struct smbd_dirptr_lanman2_state { > uint32_t info_level; > bool check_mangled_names; > bool case_sensitive; >+ bool posix_paths; > }; > > static bool smbd_dirptr_lanman2_match_fn(TALLOC_CTX *ctx, >@@ -936,7 +937,9 @@ static bool smbd_dirptr_lanman2_match_fn(TALLOC_CTX *ctx, > const char *fname; > > /* Mangle fname if it's an illegal name. */ >- if (mangle_must_mangle(dname, state->conn->params)) { >+ if (!state->posix_paths && >+ mangle_must_mangle(dname, state->conn->params)) >+ { > /* > * Slow path - ensure we can push the original name as UCS2. If > * not, then just don't return this name. >@@ -1691,7 +1694,7 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx, > }; > enum ndr_err_code ndr_err; > >- DBG_DEBUG("FSCC_FILE_POSIX_INFORMATION\n"); >+ DBG_ERR("XXX FSCC_FILE_POSIX_INFORMATION: %s, fname: %s\n", smb_fname->base_name, fname); > > p+= 4; > SIVAL(p,0,reskey); p+= 4; >@@ -1758,8 +1761,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 +1780,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; >@@ -1799,6 +1803,9 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx, > state.check_mangled_names = true; > } > state.case_sensitive = dptr_case_sensitive(dirptr); >+ if (dirfsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH) { >+ state.posix_paths = true; >+ } > > p = strrchr_m(path_mask,'/'); > if(p != NULL) { >-- >2.49.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15862
: 18647