]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Switch get_referred_path() over to use the new dfs_path_lookup().
authorJeremy Allison <jra@samba.org>
Tue, 9 Aug 2022 19:11:07 +0000 (12:11 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 12 Aug 2022 18:19:31 +0000 (18:19 +0000)
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>
source3/smbd/msdfs.c

index ab7f9f0ad78876eaa2107bf262908d8fe74187f9..55ab12a75e36e043844cee291092940f3ef79f0a 100644 (file)
@@ -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;
 }