]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: DFS: Change the last use of is_msdfs_link_internal() -> SMB_VFS_READ_DFS_PATHAT...
authorJeremy Allison <jra@samba.org>
Wed, 12 Feb 2020 21:52:58 +0000 (13:52 -0800)
committerRalph Boehme <slow@samba.org>
Tue, 18 Feb 2020 21:08:34 +0000 (21:08 +0000)
is_msdfs_link_internal() is no longer used.

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

index 023800ce97d0f8a1e0c7b20a785d809bf59631f2..6a6ee3fd5f224731323967533ea672afe10e809d 100644 (file)
@@ -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);