From: Jeremy Allison Date: Mon, 8 Aug 2022 18:31:39 +0000 (-0700) Subject: s3: smbd: Allow openat_pathref_dirfsp_nosymlink() to return NT_STATUS_PATH_NOT_COVERE... X-Git-Tag: talloc-2.4.0~1454 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5f6809593524e7e9aca1c09ff379e02a1cde61b;p=thirdparty%2Fsamba.git s3: smbd: Allow openat_pathref_dirfsp_nosymlink() to return NT_STATUS_PATH_NOT_COVERED for a DFS link on a DFS share. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 1cd146dedc7..72d1bc7d555 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -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",