mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
s3: smbd: In reply.c Use ucf_flags variable instead of passing as parameter.
This will allow us to move lp_posix_pathnames() out of unix_convert() later. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <rb@sernet.de>
This commit is contained in:
parent
e5db6763d2
commit
b2c813f176
@ -1165,6 +1165,7 @@ void reply_checkpath(struct smb_request *req)
|
|||||||
struct smb_filename *smb_fname = NULL;
|
struct smb_filename *smb_fname = NULL;
|
||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
uint32_t ucf_flags = 0;
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
|
|
||||||
START_PROFILE(SMBcheckpath);
|
START_PROFILE(SMBcheckpath);
|
||||||
@ -1185,7 +1186,7 @@ void reply_checkpath(struct smb_request *req)
|
|||||||
conn,
|
conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
name,
|
name,
|
||||||
0,
|
ucf_flags,
|
||||||
NULL,
|
NULL,
|
||||||
&smb_fname);
|
&smb_fname);
|
||||||
|
|
||||||
@ -1279,11 +1280,12 @@ void reply_getatr(struct smb_request *req)
|
|||||||
size = 0;
|
size = 0;
|
||||||
mtime = 0;
|
mtime = 0;
|
||||||
} else {
|
} else {
|
||||||
|
uint32_t ucf_flags = 0;
|
||||||
status = filename_convert(ctx,
|
status = filename_convert(ctx,
|
||||||
conn,
|
conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
fname,
|
fname,
|
||||||
0,
|
ucf_flags,
|
||||||
NULL,
|
NULL,
|
||||||
&smb_fname);
|
&smb_fname);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
@ -1364,6 +1366,7 @@ void reply_setatr(struct smb_request *req)
|
|||||||
time_t mtime;
|
time_t mtime;
|
||||||
const char *p;
|
const char *p;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
uint32_t ucf_flags = 0;
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
|
|
||||||
START_PROFILE(SMBsetatr);
|
START_PROFILE(SMBsetatr);
|
||||||
@ -1386,7 +1389,7 @@ void reply_setatr(struct smb_request *req)
|
|||||||
conn,
|
conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
fname,
|
fname,
|
||||||
0,
|
ucf_flags,
|
||||||
NULL,
|
NULL,
|
||||||
&smb_fname);
|
&smb_fname);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
@ -1668,10 +1671,11 @@ void reply_search(struct smb_request *req)
|
|||||||
/* dirtype &= ~FILE_ATTRIBUTE_DIRECTORY; */
|
/* dirtype &= ~FILE_ATTRIBUTE_DIRECTORY; */
|
||||||
|
|
||||||
if (status_len == 0) {
|
if (status_len == 0) {
|
||||||
|
uint32_t ucf_flags = UCF_ALWAYS_ALLOW_WCARD_LCOMP;
|
||||||
nt_status = filename_convert(ctx, conn,
|
nt_status = filename_convert(ctx, conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
path,
|
path,
|
||||||
UCF_ALWAYS_ALLOW_WCARD_LCOMP,
|
ucf_flags,
|
||||||
&mask_contains_wcard,
|
&mask_contains_wcard,
|
||||||
&smb_fname);
|
&smb_fname);
|
||||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
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 create_options = 0;
|
||||||
uint32_t private_flags = 0;
|
uint32_t private_flags = 0;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
uint32_t ucf_flags = UCF_PREP_CREATEFILE;
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
|
|
||||||
START_PROFILE(SMBopen);
|
START_PROFILE(SMBopen);
|
||||||
@ -2001,7 +2006,7 @@ void reply_open(struct smb_request *req)
|
|||||||
conn,
|
conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
fname,
|
fname,
|
||||||
UCF_PREP_CREATEFILE,
|
ucf_flags,
|
||||||
NULL,
|
NULL,
|
||||||
&smb_fname);
|
&smb_fname);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
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_disposition;
|
||||||
uint32_t create_options = 0;
|
uint32_t create_options = 0;
|
||||||
uint32_t private_flags = 0;
|
uint32_t private_flags = 0;
|
||||||
|
uint32_t ucf_flags = UCF_PREP_CREATEFILE;
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
|
|
||||||
START_PROFILE(SMBopenX);
|
START_PROFILE(SMBopenX);
|
||||||
@ -2171,7 +2177,7 @@ void reply_open_and_X(struct smb_request *req)
|
|||||||
conn,
|
conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
fname,
|
fname,
|
||||||
UCF_PREP_CREATEFILE,
|
ucf_flags,
|
||||||
NULL,
|
NULL,
|
||||||
&smb_fname);
|
&smb_fname);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
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 share_mode = FILE_SHARE_READ|FILE_SHARE_WRITE;
|
||||||
uint32_t create_disposition;
|
uint32_t create_disposition;
|
||||||
uint32_t create_options = 0;
|
uint32_t create_options = 0;
|
||||||
|
uint32_t ucf_flags = UCF_PREP_CREATEFILE;
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
|
|
||||||
START_PROFILE(SMBcreate);
|
START_PROFILE(SMBcreate);
|
||||||
@ -2406,7 +2413,7 @@ void reply_mknew(struct smb_request *req)
|
|||||||
conn,
|
conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
fname,
|
fname,
|
||||||
UCF_PREP_CREATEFILE,
|
ucf_flags,
|
||||||
NULL,
|
NULL,
|
||||||
&smb_fname);
|
&smb_fname);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
@ -2510,6 +2517,7 @@ void reply_ctemp(struct smb_request *req)
|
|||||||
char *s;
|
char *s;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
int i;
|
int i;
|
||||||
|
uint32_t ucf_flags = UCF_PREP_CREATEFILE;
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
|
|
||||||
START_PROFILE(SMBctemp);
|
START_PROFILE(SMBctemp);
|
||||||
@ -2549,7 +2557,7 @@ void reply_ctemp(struct smb_request *req)
|
|||||||
status = filename_convert(ctx, conn,
|
status = filename_convert(ctx, conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
fname,
|
fname,
|
||||||
UCF_PREP_CREATEFILE,
|
ucf_flags,
|
||||||
NULL,
|
NULL,
|
||||||
&smb_fname);
|
&smb_fname);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
@ -3053,6 +3061,7 @@ void reply_unlink(struct smb_request *req)
|
|||||||
uint32_t dirtype;
|
uint32_t dirtype;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
bool path_contains_wcard = False;
|
bool path_contains_wcard = False;
|
||||||
|
uint32_t ucf_flags = UCF_COND_ALLOW_WCARD_LCOMP;
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
|
|
||||||
START_PROFILE(SMBunlink);
|
START_PROFILE(SMBunlink);
|
||||||
@ -3075,7 +3084,7 @@ void reply_unlink(struct smb_request *req)
|
|||||||
status = filename_convert(ctx, conn,
|
status = filename_convert(ctx, conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
name,
|
name,
|
||||||
UCF_COND_ALLOW_WCARD_LCOMP,
|
ucf_flags,
|
||||||
&path_contains_wcard,
|
&path_contains_wcard,
|
||||||
&smb_fname);
|
&smb_fname);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
@ -5961,6 +5970,7 @@ void reply_mkdir(struct smb_request *req)
|
|||||||
struct smb_filename *smb_dname = NULL;
|
struct smb_filename *smb_dname = NULL;
|
||||||
char *directory = NULL;
|
char *directory = NULL;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
uint32_t ucf_flags = UCF_PREP_CREATEFILE;
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
|
|
||||||
START_PROFILE(SMBmkdir);
|
START_PROFILE(SMBmkdir);
|
||||||
@ -5975,7 +5985,7 @@ void reply_mkdir(struct smb_request *req)
|
|||||||
status = filename_convert(ctx, conn,
|
status = filename_convert(ctx, conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
directory,
|
directory,
|
||||||
UCF_PREP_CREATEFILE,
|
ucf_flags,
|
||||||
NULL,
|
NULL,
|
||||||
&smb_dname);
|
&smb_dname);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
@ -6031,6 +6041,7 @@ void reply_rmdir(struct smb_request *req)
|
|||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
files_struct *fsp = NULL;
|
files_struct *fsp = NULL;
|
||||||
int info = 0;
|
int info = 0;
|
||||||
|
uint32_t ucf_flags = 0;
|
||||||
struct smbd_server_connection *sconn = req->sconn;
|
struct smbd_server_connection *sconn = req->sconn;
|
||||||
|
|
||||||
START_PROFILE(SMBrmdir);
|
START_PROFILE(SMBrmdir);
|
||||||
@ -6045,7 +6056,7 @@ void reply_rmdir(struct smb_request *req)
|
|||||||
status = filename_convert(ctx, conn,
|
status = filename_convert(ctx, conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
directory,
|
directory,
|
||||||
0,
|
ucf_flags,
|
||||||
NULL,
|
NULL,
|
||||||
&smb_dname);
|
&smb_dname);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
@ -7379,6 +7390,8 @@ void reply_copy(struct smb_request *req)
|
|||||||
bool source_has_wild = False;
|
bool source_has_wild = False;
|
||||||
bool dest_has_wild = False;
|
bool dest_has_wild = False;
|
||||||
NTSTATUS status;
|
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();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
|
|
||||||
START_PROFILE(SMBcopy);
|
START_PROFILE(SMBcopy);
|
||||||
@ -7418,7 +7431,7 @@ void reply_copy(struct smb_request *req)
|
|||||||
status = filename_convert(ctx, conn,
|
status = filename_convert(ctx, conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
fname_src,
|
fname_src,
|
||||||
UCF_COND_ALLOW_WCARD_LCOMP,
|
ucf_flags_src,
|
||||||
&source_has_wild,
|
&source_has_wild,
|
||||||
&smb_fname_src);
|
&smb_fname_src);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
@ -7434,7 +7447,7 @@ void reply_copy(struct smb_request *req)
|
|||||||
status = filename_convert(ctx, conn,
|
status = filename_convert(ctx, conn,
|
||||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||||
fname_dst,
|
fname_dst,
|
||||||
UCF_COND_ALLOW_WCARD_LCOMP,
|
ucf_flags_dst,
|
||||||
&dest_has_wild,
|
&dest_has_wild,
|
||||||
&smb_fname_dst);
|
&smb_fname_dst);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user