s3: smbd: Allow openat_pathref_dirfsp_nosymlink() to return NT_STATUS_PATH_NOT_COVERE...
authorJeremy Allison <jra@samba.org>
Mon, 8 Aug 2022 18:31:39 +0000 (11:31 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 12 Aug 2022 18:19:31 +0000 (18:19 +0000)
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/files.c

index 1cd146dedc71f5d1321cbbe76ca84f7eb4f1384d..72d1bc7d5551bfdbf4ac67291a305f4100f52b1f 100644 (file)
@@ -856,6 +856,18 @@ next:
                                        *unparsed = len - parsed;
                                }
                        }
+                       /*
+                        * If we're on an MSDFS share, see if this is
+                        * an MSDFS link.
+                        */
+                       if (lp_host_msdfs() &&
+                           lp_msdfs_root(SNUM(conn)) &&
+                           (substitute != NULL) &&
+                           strnequal(*substitute, "msdfs:", 6) &&
+                           is_msdfs_link(dirfsp, &rel_fname))
+                       {
+                               status = NT_STATUS_PATH_NOT_COVERED;
+                       }
                } else {
 
                        DBG_DEBUG("readlink_talloc failed: %s\n",