summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2022-08-09 12:11:07 -0700
committerStefan Metzmacher <metze@samba.org>2022-08-16 18:27:13 +0000
commit37ce01d6ed2b90d728a16131d7b982159d580052 (patch)
tree97387138cf7c8aff3e481fbbc164d2f88c2f18f7
parentbd5c67555816623e1946b4539168af6591609d42 (diff)
downloadsamba-37ce01d6ed2b90d728a16131d7b982159d580052.tar.gz
s3: smbd: Switch get_referred_path() over to use the new dfs_path_lookup().
New function doesn't need a TWRP argument and returns NT_STATUS_OK on successful redirect, not NT_STATUS_PATH_NOT_COVERED. Comment out the old dfs_path_lookup(). There are now no more users of unix_convert(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146 (cherry picked from commit 88e8bfec59412fdc0e83251fef60b45d2cc3a884)
-rw-r--r--source3/smbd/msdfs.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index ab7f9f0ad78..55ab12a75e3 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -713,7 +713,6 @@ bool is_msdfs_link(struct files_struct *dirfsp,
return (NT_STATUS_IS_OK(status));
}
-#if 0
/*****************************************************************
Used by other functions to decide if a dfs path is remote,
and to get the list of referred locations for that remote path.
@@ -972,8 +971,8 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx,
TALLOC_FREE(canon_dfspath);
return status;
}
-#endif
+#if 0
/*****************************************************************
Used by other functions to decide if a dfs path is remote,
and to get the list of referred locations for that remote path.
@@ -1162,6 +1161,7 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx,
TALLOC_FREE(smb_fname);
return status;
}
+#endif
/*****************************************************************
Decides if a dfs pathname should be redirected or not.
@@ -1420,40 +1420,21 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
}
}
- /* If this is a DFS path dfs_lookup should return
- * NT_STATUS_PATH_NOT_COVERED. */
-
status = dfs_path_lookup(ctx,
conn,
dfs_path,
reqpath,
0, /* ucf_flags */
- NULL,
consumedcntp,
&jucn->referral_list,
&jucn->referral_count);
- if (!NT_STATUS_EQUAL(status, NT_STATUS_PATH_NOT_COVERED)) {
- DEBUG(3,("get_referred_path: No valid referrals for path %s\n",
- dfs_path));
- if (NT_STATUS_IS_OK(status)) {
- /*
- * We are in an error path here (we
- * know it's not a DFS path), but
- * dfs_path_lookup() can return
- * NT_STATUS_OK. Ensure we always
- * return a valid error code.
- *
- * #9588 - ACLs are not inherited to directories
- * for DFS shares.
- */
- status = NT_STATUS_NOT_FOUND;
- }
- goto err_exit;
+ if (!NT_STATUS_IS_OK(status)) {
+ DBG_NOTICE("No valid referrals for path %s (%s)\n",
+ dfs_path,
+ nt_errstr(status));
}
- status = NT_STATUS_OK;
- err_exit:
TALLOC_FREE(frame);
return status;
}