Fix bug #7339 - MSDFS is non-functional in 3.5.x
authorJeremy Allison <jra@samba.org>
Fri, 9 Apr 2010 03:32:36 +0000 (20:32 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 17 May 2010 07:50:10 +0000 (09:50 +0200)
commitba710ca1f15fc275b9ca630370155958abc9fd86
tree152001a575be7113dc4a2f1ea8d4da02ce3e3293
parent4edb5b0bf0158dbe16cf426729e8cd1ed23d205d
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.
(cherry picked from commit 358781559526f962c96c1af88cd104946c507d05)
(cherry picked from commit d614655f918fdbafe4520e9cc4d5de82e15b7d7d)
source3/include/proto.h
source3/smbd/filename.c
source3/smbd/msdfs.c
source3/smbd/trans2.c