summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2020-02-12 13:52:58 -0800
committerKarolin Seeger <kseeger@samba.org>2020-02-19 06:19:37 +0000
commitbbbfc6b8acd4187959c1905768f0e05792302091 (patch)
treea897a6442bd4e263fe8e18692fff4409ad8380e9
parent8690880313af37fd4d003f216fa6d16a9ee1ea9e (diff)
downloadsamba-bbbfc6b8acd4187959c1905768f0e05792302091.tar.gz
s3: DFS: Change the last use of is_msdfs_link_internal() -> SMB_VFS_READ_DFS_PATHAT() inside form_junctions().
is_msdfs_link_internal() is no longer used. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14282 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 94068b5438013479b0426fea7f83bbd7f8f935e9)
-rw-r--r--source3/smbd/msdfs.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 37018524367..0a51a32e431 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -620,6 +620,7 @@ bool parse_msdfs_symlink(TALLOC_CTX *ctx,
return true;
}
+#if 0
/**********************************************************************
Returns true if the unix path is a valid msdfs symlink and also
returns the target string from inside the link.
@@ -691,6 +692,7 @@ static bool is_msdfs_link_internal(TALLOC_CTX *ctx,
}
return False;
}
+#endif
/**********************************************************************
Returns true if the unix path is a valid msdfs symlink.
@@ -1757,7 +1759,6 @@ static int form_junctions(TALLOC_CTX *ctx,
while ((dname = vfs_readdirname(conn, dirp, NULL, &talloced))
!= NULL) {
- char *link_target = NULL;
struct smb_filename *smb_dname = NULL;
if (cnt >= jn_remain) {
@@ -1775,28 +1776,24 @@ static int form_junctions(TALLOC_CTX *ctx,
TALLOC_FREE(talloced);
goto out;
}
- if (is_msdfs_link_internal(ctx,
- conn,
- smb_dname, &link_target)) {
- if (parse_msdfs_symlink(ctx,
- lp_msdfs_shuffle_referrals(snum),
- link_target,
- &jucn[cnt].referral_list,
- &jucn[cnt].referral_count)) {
-
- jucn[cnt].service_name = talloc_strdup(ctx,
- service_name);
- jucn[cnt].volume_name = talloc_strdup(ctx,
- dname);
- if (!jucn[cnt].service_name ||
- !jucn[cnt].volume_name) {
- TALLOC_FREE(talloced);
- goto out;
- }
- jucn[cnt].comment = "";
- cnt++;
+
+ status = SMB_VFS_READ_DFS_PATHAT(conn,
+ ctx,
+ conn->cwd_fsp,
+ smb_dname,
+ &jucn[cnt].referral_list,
+ &jucn[cnt].referral_count);
+
+ if (NT_STATUS_IS_OK(status)) {
+ jucn[cnt].service_name = talloc_strdup(ctx,
+ service_name);
+ jucn[cnt].volume_name = talloc_strdup(ctx, dname);
+ if (!jucn[cnt].service_name || !jucn[cnt].volume_name) {
+ TALLOC_FREE(talloced);
+ goto out;
}
- TALLOC_FREE(link_target);
+ jucn[cnt].comment = "";
+ cnt++;
}
TALLOC_FREE(talloced);
TALLOC_FREE(smb_dname);