summaryrefslogtreecommitdiffstats
path: root/source/smbd/msdfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbd/msdfs.c')
-rw-r--r--source/smbd/msdfs.c42
1 files changed, 17 insertions, 25 deletions
diff --git a/source/smbd/msdfs.c b/source/smbd/msdfs.c
index b61a3280808..184dde16354 100644
--- a/source/smbd/msdfs.c
+++ b/source/smbd/msdfs.c
@@ -64,7 +64,7 @@ static BOOL parse_dfs_path(char* pathname, struct dfs_path* pdp)
DEBUG(10,("parse_dfs_path: servicename: %s\n",pdp->servicename));
/* rest is reqpath */
- check_path_syntax(pdp->reqpath, p+1);
+ check_path_syntax(pdp->reqpath, p+1,True);
DEBUG(10,("parse_dfs_path: rest of the path: %s\n",pdp->reqpath));
return True;
@@ -75,7 +75,7 @@ static BOOL parse_dfs_path(char* pathname, struct dfs_path* pdp)
into the dfs_path structure
**********************************************************************/
-static BOOL parse_processed_dfs_path(char* pathname, struct dfs_path* pdp, BOOL allow_wcards)
+static BOOL parse_processed_dfs_path(char* pathname, struct dfs_path* pdp)
{
pstring pathname_local;
char* p,*temp;
@@ -110,11 +110,7 @@ static BOOL parse_processed_dfs_path(char* pathname, struct dfs_path* pdp, BOOL
DEBUG(10,("parse_processed_dfs_path: servicename: %s\n",pdp->servicename));
/* rest is reqpath */
- if (allow_wcards) {
- check_path_syntax_wcard(pdp->reqpath, p+1);
- } else {
- check_path_syntax(pdp->reqpath, p+1);
- }
+ check_path_syntax(pdp->reqpath, p+1,True);
DEBUG(10,("parse_processed_dfs_path: rest of the path: %s\n",pdp->reqpath));
return True;
@@ -282,7 +278,8 @@ should try the remaining path on the redirected server.
*****************************************************************/
static BOOL resolve_dfs_path(pstring dfspath, struct dfs_path* dp,
- connection_struct* conn, BOOL search_flag,
+ connection_struct* conn,
+ BOOL findfirst_flag,
struct referral** reflistpp, int* refcntp,
BOOL* self_referralp, int* consumedcntp)
{
@@ -314,17 +311,18 @@ static BOOL resolve_dfs_path(pstring dfspath, struct dfs_path* dp,
/* check if need to redirect */
if (is_msdfs_link(conn, localpath, reflistpp, refcntp, NULL)) {
- if ( search_flag ) {
+ if (findfirst_flag) {
DEBUG(6,("resolve_dfs_path (FindFirst) No redirection "
"for dfs link %s.\n", dfspath));
return False;
+ } else {
+ DEBUG(6,("resolve_dfs_path: %s resolves to a valid Dfs link.\n",
+ dfspath));
+ if (consumedcntp)
+ *consumedcntp = strlen(dfspath);
+ return True;
}
-
- DEBUG(6,("resolve_dfs_path: %s resolves to a valid Dfs link.\n", dfspath));
- if (consumedcntp)
- *consumedcntp = strlen(dfspath);
- return True;
- }
+ }
/* redirect if any component in the path is a link */
pstrcpy(reqpath, dp->reqpath);
@@ -333,7 +331,6 @@ static BOOL resolve_dfs_path(pstring dfspath, struct dfs_path* dp,
*p = '\0';
pstrcpy(localpath, reqpath);
if (is_msdfs_link(conn, localpath, reflistpp, refcntp, NULL)) {
-
DEBUG(4, ("resolve_dfs_path: Redirecting %s because parent %s is dfs link\n", dfspath, localpath));
/* To find the path consumed, we truncate the original
@@ -341,7 +338,6 @@ static BOOL resolve_dfs_path(pstring dfspath, struct dfs_path* dp,
component. The length of the resulting string is
the path consumed
*/
-
if (consumedcntp) {
char *q;
pstring buf;
@@ -368,20 +364,17 @@ static BOOL resolve_dfs_path(pstring dfspath, struct dfs_path* dp,
/*****************************************************************
Decides if a dfs pathname should be redirected or not.
If not, the pathname is converted to a tcon-relative local unix path
-
- search_wcard_flag: this flag performs 2 functions bother related
- to searches. See resolve_dfs_path() and parse_processed_dfs_path()
- for details.
*****************************************************************/
-BOOL dfs_redirect( pstring pathname, connection_struct* conn, BOOL search_wcard_flag )
+BOOL dfs_redirect(pstring pathname, connection_struct* conn,
+ BOOL findfirst_flag)
{
struct dfs_path dp;
if (!conn || !pathname)
return False;
- parse_processed_dfs_path(pathname, &dp, search_wcard_flag);
+ parse_processed_dfs_path(pathname, &dp);
/* if dfs pathname for a non-dfs share, convert to tcon-relative
path and return false */
@@ -393,7 +386,7 @@ BOOL dfs_redirect( pstring pathname, connection_struct* conn, BOOL search_wcard_
if (!strequal(dp.servicename, lp_servicename(SNUM(conn)) ))
return False;
- if (resolve_dfs_path(pathname, &dp, conn, search_wcard_flag,
+ if (resolve_dfs_path(pathname, &dp, conn, findfirst_flag,
NULL, NULL, NULL, NULL)) {
DEBUG(3,("dfs_redirect: Redirecting %s\n", pathname));
return True;
@@ -809,7 +802,6 @@ int setup_dfs_referral(connection_struct *orig_conn, char *pathname, int max_ref
/**********************************************************************
Creates a junction structure from a Dfs pathname
**********************************************************************/
-
BOOL create_junction(char* pathname, struct junction_map* jucn)
{
struct dfs_path dp;