If the terminal component was an MSDFS link, openat_pathref_fsp_case_insensitive() will
return NT_STATUS_OBJECT_NAME_NOT_FOUND with a VALID_STAT of a symlink.
If this is the case, check if we actually found a terminal MS-DFS link
at the end of the pathname and return NT_STATUS_PATH_NOT_COVERED.
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>
char *normalized = NULL;
if (VALID_STAT(smb_fname_rel->st)) {
+ /*
+ * If we're on an MSDFS share, see if this is
+ * an MSDFS link.
+ */
+ if (lp_host_msdfs() &&
+ lp_msdfs_root(SNUM(conn)) &&
+ S_ISLNK(smb_fname_rel->st.st_ex_mode) &&
+ is_msdfs_link(smb_dirname->fsp, smb_fname_rel))
+ {
+ status = NT_STATUS_PATH_NOT_COVERED;
+ goto fail;
+ }
+
#if defined(WITH_SMB1SERVER)
/*
* In SMB1 posix mode, if this is a symlink,