summaryrefslogtreecommitdiff
path: root/source3/smbd/filename.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-04-08 20:32:36 -0700
committerJeremy Allison <jra@samba.org>2010-04-08 20:32:36 -0700
commit358781559526f962c96c1af88cd104946c507d05 (patch)
tree1bb2624951e6efd8e035b3c19933b676a271ca43 /source3/smbd/filename.c
parent8126c78c76965fe6158fb8ef426abf256551e725 (diff)
downloadsamba-358781559526f962c96c1af88cd104946c507d05.tar.gz
samba-358781559526f962c96c1af88cd104946c507d05.tar.bz2
samba-358781559526f962c96c1af88cd104946c507d05.zip
Fix bug #7339 - MSDFS is non-functional in 3.5.x
In the refactoring around filename_convert, the split between the functions resolve_dfspath() and resolve_dfspath_wcard() was lost, leaving us only with resolve_dfspath_wcard(). Internally resolve_dfspath_wcard() calls dfs_redirect() only with a "allow_wcards" flag of true, wheras the old resolve_dfspath() would call with a value of false. The loss of this case causes dfs_redirect to always masquerade DFS links as directories, even when they are being queried directly by a trans2 QPATHINFO call. We should only masquerade DFS links as directories when called from a SMBsearch or trans2 findfirst/findnext - which was the intent of the "allow_wcards" flag. This patch adds back an allow_wcards bool parameter to resolve_dfspath_wcard(). This bool is set from the state of the ucf_flags when filename_convert() is called. I will follow this up with a new smbclient-based torture test that will prevent us from ever regressing our DFS support again. Jeremy.
Diffstat (limited to 'source3/smbd/filename.c')
-rw-r--r--source3/smbd/filename.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index ab79dfd926..154d34a4c0 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -1125,6 +1125,7 @@ NTSTATUS filename_convert(TALLOC_CTX *ctx,
struct smb_filename **pp_smb_fname)
{
NTSTATUS status;
+ bool allow_wcards = (ucf_flags & (UCF_COND_ALLOW_WCARD_LCOMP|UCF_ALWAYS_ALLOW_WCARD_LCOMP));
char *fname = NULL;
*pp_smb_fname = NULL;
@@ -1132,6 +1133,7 @@ NTSTATUS filename_convert(TALLOC_CTX *ctx,
status = resolve_dfspath_wcard(ctx, conn,
dfs_path,
name_in,
+ allow_wcards,
&fname,
ppath_contains_wcard);
if (!NT_STATUS_IS_OK(status)) {