From 7b2c2e415543aaee13193be1bd11706f2528c692 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 7 Mar 2007 22:12:58 +0000 Subject: r21754: Volker is completely correct. There's no need for the RESOLVE_DFSPATH macros and their varients any more. Fix reporting profile bug with all error returns. Jeremy. (This used to be commit cdf0fdb1049fd68b46885cbea887dc0e595fa524) --- source3/smbd/msdfs.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'source3/smbd/msdfs.c') diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index c24cdcc708..f06bb3b044 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -3,6 +3,7 @@ Version 3.0 MSDfs services for Samba Copyright (C) Shirish Kalele 2000 + Copyright (C) Jeremy Allison 2007 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -435,7 +436,7 @@ static BOOL resolve_dfs_path(TALLOC_CTX *ctx, for details. *****************************************************************/ -BOOL dfs_redirect( pstring pathname, connection_struct *conn, BOOL search_wcard_flag ) +static BOOL dfs_redirect( connection_struct *conn, pstring pathname, BOOL search_wcard_flag ) { struct dfs_path dp; @@ -1149,3 +1150,32 @@ int enum_msdfs_links(TALLOC_CTX *ctx, struct junction_map *jucn, int jn_max) } return jn_count; } + +/****************************************************************************** + Core function to resolve a dfs pathname. +******************************************************************************/ + +BOOL resolve_dfspath(connection_struct *conn, BOOL dfs_pathnames, pstring name) +{ + if (dfs_pathnames && lp_host_msdfs() && lp_msdfs_root(SNUM(conn)) && + dfs_redirect(conn, name, False)) { + return False; /* Pathname didn't resolve. */ + } + return True; +} + +/****************************************************************************** + Core function to resolve a dfs pathname possibly containing a wildcard. + This function is identical to the above except for the BOOL param to + dfs_redirect but I need this to be separate so it's really clear when + we're allowing wildcards and when we're not. JRA. +******************************************************************************/ + +BOOL resolve_dfspath_wcard(connection_struct *conn, BOOL dfs_pathnames, pstring name) +{ + if (dfs_pathnames && lp_host_msdfs() && lp_msdfs_root(SNUM(conn)) && + dfs_redirect(conn, name, True)) { + return False; /* Pathname didn't resolve. */ + } + return True; +} -- cgit