diff options
author | Jeremy Allison <jra@samba.org> | 2020-02-12 13:52:58 -0800 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2020-02-18 21:08:34 +0000 |
commit | 94068b5438013479b0426fea7f83bbd7f8f935e9 (patch) | |
tree | 3431b92528563356efbb19a5af94d25e63d4f14c /source3/smbd/msdfs.c | |
parent | 3c77a9e7116bc3f1e3c9bf89c28a32bdb6cdffe1 (diff) | |
download | samba-94068b5438013479b0426fea7f83bbd7f8f935e9.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.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/smbd/msdfs.c')
-rw-r--r-- | source3/smbd/msdfs.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 023800ce97d..6a6ee3fd5f2 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. @@ -1778,7 +1780,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) { @@ -1796,28 +1797,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); |