diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 92349789bed..269c889e5b7 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1165,6 +1165,7 @@ void reply_checkpath(struct smb_request *req) struct smb_filename *smb_fname = NULL; char *name = NULL; NTSTATUS status; + uint32_t ucf_flags = 0; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBcheckpath); @@ -1185,7 +1186,7 @@ void reply_checkpath(struct smb_request *req) conn, req->flags2 & FLAGS2_DFS_PATHNAMES, name, - 0, + ucf_flags, NULL, &smb_fname); @@ -1279,11 +1280,12 @@ void reply_getatr(struct smb_request *req) size = 0; mtime = 0; } else { + uint32_t ucf_flags = 0; status = filename_convert(ctx, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname, - 0, + ucf_flags, NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { @@ -1364,6 +1366,7 @@ void reply_setatr(struct smb_request *req) time_t mtime; const char *p; NTSTATUS status; + uint32_t ucf_flags = 0; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBsetatr); @@ -1386,7 +1389,7 @@ void reply_setatr(struct smb_request *req) conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname, - 0, + ucf_flags, NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { @@ -1668,10 +1671,11 @@ void reply_search(struct smb_request *req) /* dirtype &= ~FILE_ATTRIBUTE_DIRECTORY; */ if (status_len == 0) { + uint32_t ucf_flags = UCF_ALWAYS_ALLOW_WCARD_LCOMP; nt_status = filename_convert(ctx, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, path, - UCF_ALWAYS_ALLOW_WCARD_LCOMP, + ucf_flags, &mask_contains_wcard, &smb_fname); if (!NT_STATUS_IS_OK(nt_status)) { @@ -1969,6 +1973,7 @@ void reply_open(struct smb_request *req) uint32_t create_options = 0; uint32_t private_flags = 0; NTSTATUS status; + uint32_t ucf_flags = UCF_PREP_CREATEFILE; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBopen); @@ -2001,7 +2006,7 @@ void reply_open(struct smb_request *req) conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname, - UCF_PREP_CREATEFILE, + ucf_flags, NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { @@ -2121,6 +2126,7 @@ void reply_open_and_X(struct smb_request *req) uint32_t create_disposition; uint32_t create_options = 0; uint32_t private_flags = 0; + uint32_t ucf_flags = UCF_PREP_CREATEFILE; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBopenX); @@ -2171,7 +2177,7 @@ void reply_open_and_X(struct smb_request *req) conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname, - UCF_PREP_CREATEFILE, + ucf_flags, NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { @@ -2379,6 +2385,7 @@ void reply_mknew(struct smb_request *req) uint32_t share_mode = FILE_SHARE_READ|FILE_SHARE_WRITE; uint32_t create_disposition; uint32_t create_options = 0; + uint32_t ucf_flags = UCF_PREP_CREATEFILE; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBcreate); @@ -2406,7 +2413,7 @@ void reply_mknew(struct smb_request *req) conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname, - UCF_PREP_CREATEFILE, + ucf_flags, NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { @@ -2510,6 +2517,7 @@ void reply_ctemp(struct smb_request *req) char *s; NTSTATUS status; int i; + uint32_t ucf_flags = UCF_PREP_CREATEFILE; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBctemp); @@ -2549,7 +2557,7 @@ void reply_ctemp(struct smb_request *req) status = filename_convert(ctx, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname, - UCF_PREP_CREATEFILE, + ucf_flags, NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { @@ -3053,6 +3061,7 @@ void reply_unlink(struct smb_request *req) uint32_t dirtype; NTSTATUS status; bool path_contains_wcard = False; + uint32_t ucf_flags = UCF_COND_ALLOW_WCARD_LCOMP; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBunlink); @@ -3075,7 +3084,7 @@ void reply_unlink(struct smb_request *req) status = filename_convert(ctx, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, name, - UCF_COND_ALLOW_WCARD_LCOMP, + ucf_flags, &path_contains_wcard, &smb_fname); if (!NT_STATUS_IS_OK(status)) { @@ -5961,6 +5970,7 @@ void reply_mkdir(struct smb_request *req) struct smb_filename *smb_dname = NULL; char *directory = NULL; NTSTATUS status; + uint32_t ucf_flags = UCF_PREP_CREATEFILE; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBmkdir); @@ -5975,7 +5985,7 @@ void reply_mkdir(struct smb_request *req) status = filename_convert(ctx, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, directory, - UCF_PREP_CREATEFILE, + ucf_flags, NULL, &smb_dname); if (!NT_STATUS_IS_OK(status)) { @@ -6031,6 +6041,7 @@ void reply_rmdir(struct smb_request *req) TALLOC_CTX *ctx = talloc_tos(); files_struct *fsp = NULL; int info = 0; + uint32_t ucf_flags = 0; struct smbd_server_connection *sconn = req->sconn; START_PROFILE(SMBrmdir); @@ -6045,7 +6056,7 @@ void reply_rmdir(struct smb_request *req) status = filename_convert(ctx, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, directory, - 0, + ucf_flags, NULL, &smb_dname); if (!NT_STATUS_IS_OK(status)) { @@ -7379,6 +7390,8 @@ void reply_copy(struct smb_request *req) bool source_has_wild = False; bool dest_has_wild = False; NTSTATUS status; + uint32_t ucf_flags_src = UCF_COND_ALLOW_WCARD_LCOMP; + uint32_t ucf_flags_dst = UCF_COND_ALLOW_WCARD_LCOMP; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBcopy); @@ -7418,7 +7431,7 @@ void reply_copy(struct smb_request *req) status = filename_convert(ctx, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname_src, - UCF_COND_ALLOW_WCARD_LCOMP, + ucf_flags_src, &source_has_wild, &smb_fname_src); if (!NT_STATUS_IS_OK(status)) { @@ -7434,7 +7447,7 @@ void reply_copy(struct smb_request *req) status = filename_convert(ctx, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname_dst, - UCF_COND_ALLOW_WCARD_LCOMP, + ucf_flags_dst, &dest_has_wild, &smb_fname_dst); if (!NT_STATUS_IS_OK(status)) {