summaryrefslogtreecommitdiff
path: root/source3/smbd/msdfs.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-21 18:04:47 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-21 18:04:47 +0200
commit20796bcf57a7f5e1921dc12e0568221f985fe4f2 (patch)
tree8f0540a602a9ea0031d656bc31c0b8bc1e91eb70 /source3/smbd/msdfs.c
parent323be4a6907e4915bb76aa103bf5b868f0b459b1 (diff)
parent1a416ff13ca7786f2e8d24c66addf00883e9cb12 (diff)
downloadsamba-20796bcf57a7f5e1921dc12e0568221f985fe4f2.tar.gz
samba-20796bcf57a7f5e1921dc12e0568221f985fe4f2.tar.bz2
samba-20796bcf57a7f5e1921dc12e0568221f985fe4f2.zip
Merge branch 'v3-3-test' of ssh://git.samba.org/data/git/samba into docbook
Conflicts: source/Makefile.in (This used to be commit 01987778a123f853fccdcb7fe9566143e2d7c490)
Diffstat (limited to 'source3/smbd/msdfs.c')
-rw-r--r--source3/smbd/msdfs.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 04b9b7deaa..e4760ec461 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -36,13 +36,17 @@ extern uint32 global_client_caps;
SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES bit and then
send a local path, we have to cope with that too....
+ If conn != NULL then ensure the provided service is
+ the one pointed to by the connection.
+
This version does everything using pointers within one copy of the
pathname string, talloced on the struct dfs_path pointer (which
must be talloced). This may be too clever to live....
JRA.
**********************************************************************/
-static NTSTATUS parse_dfs_path(const char *pathname,
+static NTSTATUS parse_dfs_path(connection_struct *conn,
+ const char *pathname,
bool allow_wcards,
struct dfs_path *pdp, /* MUST BE TALLOCED */
bool *ppath_contains_wcard)
@@ -136,7 +140,10 @@ static NTSTATUS parse_dfs_path(const char *pathname,
}
/* Is this really our servicename ? */
- if (NULL == conn_find_byname(servicename)) {
+ if (conn && !( strequal(servicename, lp_servicename(SNUM(conn)))
+ || (strequal(servicename, HOMES_NAME)
+ && strequal(lp_servicename(SNUM(conn)),
+ get_current_username()) )) ) {
DEBUG(10,("parse_dfs_path: %s is not our servicename\n",
servicename));
@@ -624,7 +631,7 @@ static NTSTATUS dfs_redirect(TALLOC_CTX *ctx,
return NT_STATUS_NO_MEMORY;
}
- status = parse_dfs_path(path_in, search_wcard_flag, pdp,
+ status = parse_dfs_path(conn, path_in, search_wcard_flag, pdp,
ppath_contains_wcard);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(pdp);
@@ -665,17 +672,6 @@ static NTSTATUS dfs_redirect(TALLOC_CTX *ctx,
return NT_STATUS_OK;
}
- if (!( strequal(pdp->servicename, lp_servicename(SNUM(conn)))
- || (strequal(pdp->servicename, HOMES_NAME)
- && strequal(lp_servicename(SNUM(conn)),
- get_current_username()) )) ) {
-
- /* The given sharename doesn't match this connection. */
- TALLOC_FREE(pdp);
-
- return NT_STATUS_OBJECT_PATH_NOT_FOUND;
- }
-
status = dfs_path_lookup(ctx, conn, path_in, pdp,
search_wcard_flag, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
@@ -759,7 +755,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
*self_referralp = False;
- status = parse_dfs_path(dfs_path, False, pdp, &dummy);
+ status = parse_dfs_path(NULL, dfs_path, False, pdp, &dummy);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -1245,7 +1241,7 @@ bool create_junction(TALLOC_CTX *ctx,
if (!pdp) {
return False;
}
- status = parse_dfs_path(dfs_path, False, pdp, &dummy);
+ status = parse_dfs_path(NULL, dfs_path, False, pdp, &dummy);
if (!NT_STATUS_IS_OK(status)) {
return False;
}