s3: smbd: dfs: Move lp_msdfs_shuffle_referrals() call out of parse_msdfs_symlink().
authorJeremy Allison <jra@samba.org>
Tue, 28 Jan 2020 00:31:52 +0000 (16:31 -0800)
committerRalph Boehme <slow@samba.org>
Tue, 18 Feb 2020 21:08:32 +0000 (21:08 +0000)
Removes dependency on snum for what is text parsing code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/msdfs.c

index debc38a5307e474f32244f4be7070192092caded..8a682aad4991ca09338f0b134a781d494793fbcd 100644 (file)
@@ -524,7 +524,7 @@ static void shuffle_strlist(char **list, int count)
  **********************************************************************/
 
 static bool parse_msdfs_symlink(TALLOC_CTX *ctx,
-                               int snum,
+                               bool shuffle_referrals,
                                const char *target,
                                struct referral **preflist,
                                size_t *refcount)
@@ -558,7 +558,7 @@ static bool parse_msdfs_symlink(TALLOC_CTX *ctx,
        }
 
        /* shuffle alternate paths */
-       if (lp_msdfs_shuffle_referrals(snum)) {
+       if (shuffle_referrals) {
                shuffle_strlist(alt_path, count);
        }
 
@@ -1100,7 +1100,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
                }
 
                if (!parse_msdfs_symlink(ctx,
-                               snum,
+                               lp_msdfs_shuffle_referrals(snum),
                                tmp,
                                &ref,
                                &refcount)) {
@@ -1175,7 +1175,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
 
        /* We know this is a valid dfs link. Parse the targetpath. */
        if (!parse_msdfs_symlink(ctx,
-                               snum,
+                               lp_msdfs_shuffle_referrals(snum),
                                targetpath,
                                &jucn->referral_list,
                                &jucn->referral_count)) {
@@ -1770,7 +1770,7 @@ static int form_junctions(TALLOC_CTX *ctx,
                                        conn,
                                        smb_dname, &link_target)) {
                        if (parse_msdfs_symlink(ctx,
-                                       snum,
+                                       lp_msdfs_shuffle_referrals(snum),
                                        link_target,
                                        &jucn[cnt].referral_list,
                                        &jucn[cnt].referral_count)) {