[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Wed Dec 23 05:32:03 UTC 2015
The branch, master has been updated
via 035bd5f s3: smbd: Remove lp_posix_pathnames() from filename.c
via 993122a s3: smbd: In trans2.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
via 274e8b5 s3: smbd: In smb2_query_directory.c.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
via 31212e9 s3: smbd: In smb2_create.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
via dae4b37 s3: smbd: In reply.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
via 6694c82 s3: smbd: In open.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
via 4ce5de5 s3: smbd: In srv_srvsvc_nt.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
via 7641c69 s3: smbd: In nttrans2.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
via acf6600 s3: smbd: In smb2_query_directory.c Use ucf_flags variable instead of passing as parameter.
via c783db3 s3: smbd: In smb2_create.c Use ucf_flags variable instead of passing as parameter.
via 5d03e75 s3: smbd: In srv_srvsvc_nt.c Use ucf_flags variable instead of passing as parameter.
via f3f3426 s3: smbd: In trans2.c Use ucf_flags variable instead of passing as parameter.
via b2c813f s3: smbd: In reply.c Use ucf_flags variable instead of passing as parameter.
via e5db676 s3: smbd: In open.c Use ucf_flags variable instead of passing as parameter.
via 5c183b2 s3: smbd: Use ucf_flags variable instead of passing as parameter.
via 5f407e3 Fix typo in winbindd_cm.c
from 00e952e s3: fix encryption help messages
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 035bd5feb854143c8dd784623a04f0a12e4c94aa
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:32:20 2015 -0800
s3: smbd: Remove lp_posix_pathnames() from filename.c
Now correctly passed in everywhere as the UCF_POSIX_PATHNAMES flag.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Dec 23 06:31:28 CET 2015 on sn-devel-144
commit 993122aa2c9137db31e748f6a69c491e10c25efb
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:31:20 2015 -0800
s3: smbd: In trans2.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit 274e8b5409600dc294457f35405c6bb870703d6d
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:27:39 2015 -0800
s3: smbd: In smb2_query_directory.c.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit 31212e958787c4a60ca8afa03f92109373d77c92
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:26:18 2015 -0800
s3: smbd: In smb2_create.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit dae4b3751492d8dc2486d4dfd908132ead9e3538
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:25:16 2015 -0800
s3: smbd: In reply.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit 6694c82c9aa537ee7959283bec15f23c4d76c2f1
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:19:23 2015 -0800
s3: smbd: In open.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit 4ce5de5fd9e2aaa4f21e63fbd32b245f280c47ab
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:18:19 2015 -0800
s3: smbd: In srv_srvsvc_nt.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit 7641c69563a105f6a2263f563c2d09c8a895850b
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:16:27 2015 -0800
s3: smbd: In nttrans2.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit acf66001329ec31e18a52497b6ad9c817f4a0e2f
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:12:34 2015 -0800
s3: smbd: In smb2_query_directory.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 at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit c783db3ac92c78ad7b07392bfb49f021963dd7ff
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:08:38 2015 -0800
s3: smbd: In smb2_create.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 at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit 5d03e7550bde784df0e691447d925a4d0af76e3a
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:07:16 2015 -0800
s3: smbd: In srv_srvsvc_nt.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 at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit f3f3426f689d80102fbbdc6b69aec1633a74a835
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 11:05:46 2015 -0800
s3: smbd: In trans2.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 at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit b2c813f176493605bc6a46d1f52b7e16cfa1209c
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 10:58:44 2015 -0800
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 at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit e5db6763d2e9ccccba1bcfcd1a642c81ae794e05
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 10:51:35 2015 -0800
s3: smbd: In open.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 at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit 5c183b22d1b00b99e0deda3c6e6e1c08d0b7149c
Author: Jeremy Allison <jra at samba.org>
Date: Tue Dec 22 10:49:08 2015 -0800
s3: smbd: 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 at samba.org>
Reviewed-by: Ralph Boehme <rb at sernet.de>
commit 5f407e3fb829ca790549d672a2625a15f337616c
Author: Marc Muehlfeld <mmuehlfeld at samba.org>
Date: Tue Dec 22 21:13:52 2015 +0100
Fix typo in winbindd_cm.c
Signed-off-by: Marc Muehlfeld <mmuehlfeld at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
-----------------------------------------------------------------------
Summary of changes:
source3/rpc_server/srvsvc/srv_srvsvc_nt.c | 6 ++--
source3/smbd/filename.c | 3 +-
source3/smbd/nttrans.c | 12 ++++---
source3/smbd/open.c | 3 +-
source3/smbd/reply.c | 57 +++++++++++++++++++++++--------
source3/smbd/smb2_create.c | 8 +++--
source3/smbd/smb2_query_directory.c | 6 +++-
source3/smbd/trans2.c | 26 +++++++++-----
source3/winbindd/winbindd_cm.c | 2 +-
9 files changed, 87 insertions(+), 36 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
index 96c022b..fd71650 100644
--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
@@ -2311,6 +2311,7 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
files_struct *fsp = NULL;
int snum;
char *oldcwd = NULL;
+ uint32_t ucf_flags = (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
ZERO_STRUCT(st);
@@ -2346,7 +2347,7 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
conn,
false,
r->in.file,
- 0,
+ ucf_flags,
NULL,
&smb_fname);
if (!NT_STATUS_IS_OK(nt_status)) {
@@ -2458,6 +2459,7 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
char *oldcwd = NULL;
struct security_descriptor *psd = NULL;
uint32_t security_info_sent = 0;
+ uint32_t ucf_flags = (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
ZERO_STRUCT(st);
@@ -2495,7 +2497,7 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
conn,
false,
r->in.file,
- 0,
+ ucf_flags,
NULL,
&smb_fname);
if (!NT_STATUS_IS_OK(nt_status)) {
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 1174b59..c2ed1fc 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -240,8 +240,7 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
char *stream = NULL;
bool component_was_mangled = False;
bool name_has_wildcard = False;
- bool posix_pathnames = (lp_posix_pathnames() ||
- (ucf_flags & UCF_POSIX_PATHNAMES));
+ bool posix_pathnames = (ucf_flags & UCF_POSIX_PATHNAMES);
bool allow_wcard_last_component =
(ucf_flags & UCF_ALWAYS_ALLOW_WCARD_LCOMP);
bool save_last_component = ucf_flags & UCF_SAVE_LCOMP;
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 098d88b..6ef4c5a 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -461,6 +461,8 @@ void reply_ntcreate_and_X(struct smb_request *req)
int oplock_request;
uint8_t oplock_granted = NO_OPLOCK_RETURN;
struct case_semantics_state *case_state = NULL;
+ uint32_t ucf_flags = UCF_PREP_CREATEFILE |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBntcreateX);
@@ -538,7 +540,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- UCF_PREP_CREATEFILE,
+ ucf_flags,
NULL,
&smb_fname);
@@ -1000,6 +1002,8 @@ static void call_nt_transact_create(connection_struct *conn,
int oplock_request;
uint8_t oplock_granted;
struct case_semantics_state *case_state = NULL;
+ uint32_t ucf_flags = UCF_PREP_CREATEFILE |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
DEBUG(5,("call_nt_transact_create\n"));
@@ -1068,7 +1072,7 @@ static void call_nt_transact_create(connection_struct *conn,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- UCF_PREP_CREATEFILE,
+ ucf_flags,
NULL,
&smb_fname);
@@ -1524,8 +1528,8 @@ void reply_ntrename(struct smb_request *req)
bool src_has_wcard = False;
bool dest_has_wcard = False;
uint32_t attrs;
- uint32_t ucf_flags_src = 0;
- uint32_t ucf_flags_dst = 0;
+ uint32_t ucf_flags_src = (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
+ uint32_t ucf_flags_dst = (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
uint16_t rename_type;
TALLOC_CTX *ctx = talloc_tos();
bool stream_rename = false;
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 4053089..d728782 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -4828,6 +4828,7 @@ NTSTATUS get_relative_fid_filename(connection_struct *conn,
files_struct *dir_fsp;
char *parent_fname = NULL;
char *new_base_name = NULL;
+ uint32_t ucf_flags = (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
NTSTATUS status;
if (root_dir_fid == 0 || !smb_fname) {
@@ -4922,7 +4923,7 @@ NTSTATUS get_relative_fid_filename(connection_struct *conn,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
new_base_name,
- 0,
+ ucf_flags,
NULL,
smb_fname_out);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 9234978..b1ca7a5 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 = (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 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,13 @@ void reply_getatr(struct smb_request *req)
size = 0;
mtime = 0;
} else {
+ uint32_t ucf_flags = (lp_posix_pathnames() ?
+ UCF_POSIX_PATHNAMES : 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 +1367,7 @@ void reply_setatr(struct smb_request *req)
time_t mtime;
const char *p;
NTSTATUS status;
+ uint32_t ucf_flags = (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBsetatr);
@@ -1386,7 +1390,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 +1672,12 @@ void reply_search(struct smb_request *req)
/* dirtype &= ~FILE_ATTRIBUTE_DIRECTORY; */
if (status_len == 0) {
+ uint32_t ucf_flags = UCF_ALWAYS_ALLOW_WCARD_LCOMP |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
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 +1975,8 @@ 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 |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBopen);
@@ -2001,7 +2009,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 +2129,8 @@ 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 |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBopenX);
@@ -2171,7 +2181,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 +2389,8 @@ 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 |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBcreate);
@@ -2406,7 +2418,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 +2522,8 @@ void reply_ctemp(struct smb_request *req)
char *s;
NTSTATUS status;
int i;
+ uint32_t ucf_flags = UCF_PREP_CREATEFILE |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBctemp);
@@ -2549,7 +2563,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 +3067,8 @@ 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 |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBunlink);
@@ -3075,7 +3091,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 +5977,8 @@ 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 |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBmkdir);
@@ -5975,7 +5993,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 +6049,7 @@ void reply_rmdir(struct smb_request *req)
TALLOC_CTX *ctx = talloc_tos();
files_struct *fsp = NULL;
int info = 0;
+ uint32_t ucf_flags = (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
struct smbd_server_connection *sconn = req->sconn;
START_PROFILE(SMBrmdir);
@@ -6045,7 +6064,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)) {
@@ -7067,8 +7086,12 @@ void reply_mv(struct smb_request *req)
TALLOC_CTX *ctx = talloc_tos();
struct smb_filename *smb_fname_src = NULL;
struct smb_filename *smb_fname_dst = NULL;
- uint32_t src_ucf_flags = lp_posix_pathnames() ? UCF_UNIX_NAME_LOOKUP : UCF_COND_ALLOW_WCARD_LCOMP;
- uint32_t dst_ucf_flags = UCF_SAVE_LCOMP | (lp_posix_pathnames() ? 0 : UCF_COND_ALLOW_WCARD_LCOMP);
+ uint32_t src_ucf_flags = (lp_posix_pathnames() ?
+ (UCF_UNIX_NAME_LOOKUP|UCF_POSIX_PATHNAMES) :
+ UCF_COND_ALLOW_WCARD_LCOMP);
+ uint32_t dst_ucf_flags = UCF_SAVE_LCOMP |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES :
+ UCF_COND_ALLOW_WCARD_LCOMP);
bool stream_rename = false;
START_PROFILE(SMBmv);
@@ -7379,6 +7402,10 @@ 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 |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
+ uint32_t ucf_flags_dst = UCF_COND_ALLOW_WCARD_LCOMP |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBcopy);
@@ -7418,7 +7445,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 +7461,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)) {
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index 1b12962..db706f0 100644
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -379,6 +379,8 @@ static NTSTATUS smbd_smb2_create_durable_lease_check(
const struct smb2_lease *lease_ptr)
{
struct smb_filename *smb_fname = NULL;
+ uint32_t ucf_flags = UCF_PREP_CREATEFILE |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
NTSTATUS status;
if (lease_ptr == NULL) {
@@ -404,7 +406,7 @@ static NTSTATUS smbd_smb2_create_durable_lease_check(
}
status = filename_convert(talloc_tos(), fsp->conn, false,
- requested_filename, UCF_PREP_CREATEFILE,
+ requested_filename, ucf_flags,
NULL, &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("filename_convert returned %s\n",
@@ -1004,6 +1006,8 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
info = FILE_WAS_OPENED;
} else {
struct smb_filename *smb_fname = NULL;
+ uint32_t ucf_flags = UCF_PREP_CREATEFILE |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
if (requested_oplock_level == SMB2_OPLOCK_LEVEL_LEASE) {
if (lease_ptr == NULL) {
@@ -1031,7 +1035,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
smb1req->conn,
smb1req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- UCF_PREP_CREATEFILE,
+ ucf_flags,
NULL, /* ppath_contains_wcards */
&smb_fname);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c
index 56dab69..57c1393 100644
--- a/source3/smbd/smb2_query_directory.c
+++ b/source3/smbd/smb2_query_directory.c
@@ -335,6 +335,10 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
const char *fullpath;
char tmpbuf[PATH_MAX];
char *to_free = NULL;
+ uint32_t ucf_flags = UCF_SAVE_LCOMP |
+ UCF_ALWAYS_ALLOW_WCARD_LCOMP |
+ (lp_posix_pathnames() ?
+ UCF_POSIX_PATHNAMES : 0);
if (ISDOT(fsp->fsp_name->base_name)) {
fullpath = in_file_name;
@@ -355,7 +359,7 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
conn,
false, /* Not a DFS path. */
fullpath,
- UCF_SAVE_LCOMP | UCF_ALWAYS_ALLOW_WCARD_LCOMP,
+ ucf_flags,
&wcard_has_wild,
&smb_fname);
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 11c97e8..2702545 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1097,6 +1097,7 @@ static void call_trans2open(connection_struct *conn,
uint32_t create_disposition;
uint32_t create_options = 0;
uint32_t private_flags = 0;
+ uint32_t ucf_flags = (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
/*
@@ -1146,7 +1147,7 @@ static void call_trans2open(connection_struct *conn,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- 0,
+ ucf_flags,
NULL,
&smb_fname);
if (!NT_STATUS_IS_OK(status)) {
@@ -2477,7 +2478,8 @@ static void call_trans2findfirst(connection_struct *conn,
TALLOC_CTX *ctx = talloc_tos();
struct dptr_struct *dirptr = NULL;
struct smbd_server_connection *sconn = req->sconn;
- uint32_t ucf_flags = (UCF_SAVE_LCOMP | UCF_ALWAYS_ALLOW_WCARD_LCOMP);
+ uint32_t ucf_flags = UCF_SAVE_LCOMP | UCF_ALWAYS_ALLOW_WCARD_LCOMP |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
bool backup_priv = false;
bool as_root = false;
@@ -5542,7 +5544,8 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
} else {
uint32_t name_hash;
char *fname = NULL;
- uint32_t ucf_flags = 0;
+ uint32_t ucf_flags = (lp_posix_pathnames() ?
+ UCF_POSIX_PATHNAMES : 0);
/* qpathinfo */
if (total_params < 7) {
@@ -6372,6 +6375,7 @@ static NTSTATUS smb_set_file_unix_hlink(connection_struct *conn,
{
char *oldname = NULL;
struct smb_filename *smb_fname_old = NULL;
+ uint32_t ucf_flags = (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
TALLOC_CTX *ctx = talloc_tos();
NTSTATUS status = NT_STATUS_OK;
@@ -6393,7 +6397,7 @@ static NTSTATUS smb_set_file_unix_hlink(connection_struct *conn,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
oldname,
- 0,
+ ucf_flags,
NULL,
&smb_fname_old);
if (!NT_STATUS_IS_OK(status)) {
@@ -6419,6 +6423,8 @@ static NTSTATUS smb2_file_rename_information(connection_struct *conn,
uint32_t len;
char *newname = NULL;
struct smb_filename *smb_fname_dst = NULL;
+ uint32_t ucf_flags = UCF_SAVE_LCOMP |
+ (lp_posix_pathnames() ? UCF_POSIX_PATHNAMES : 0);
NTSTATUS status = NT_STATUS_OK;
TALLOC_CTX *ctx = talloc_tos();
@@ -6451,7 +6457,7 @@ static NTSTATUS smb2_file_rename_information(connection_struct *conn,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
newname,
- UCF_SAVE_LCOMP,
+ ucf_flags,
NULL,
&smb_fname_dst);
if (!NT_STATUS_IS_OK(status)) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list