From: Ralph Boehme Date: Fri, 16 Oct 2020 13:47:50 +0000 (+0200) Subject: vfs_default: return stat info for symlinks in POSIX context X-Git-Tag: samba-4.14.0rc1~320 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36d72d8a81b9436e067a553d39056de9dc84deec;p=thirdparty%2Fsamba.git vfs_default: return stat info for symlinks in POSIX context Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index b242e677717..9de7e9caffa 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -619,10 +619,13 @@ static struct dirent *vfswrap_readdir(vfs_handle_struct *handle, /* * As this is an optimization, ignore it if we stat'ed a - * symlink. Make the caller do it again as we don't know if - * they wanted the link info, or its target info. + * symlink for non-POSIX context. Make the caller do it again + * as we don't know if they wanted the link info, or its + * target info. */ - if (S_ISLNK(st.st_mode)) { + if (S_ISLNK(st.st_mode) && + !(dirfsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH)) + { return result; } init_stat_ex_from_stat(sbuf, &st, fake_ctime);