]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_default: return stat info for symlinks in POSIX context
authorRalph Boehme <slow@samba.org>
Fri, 16 Oct 2020 13:47:50 +0000 (15:47 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_default.c

index b242e677717135a14e4c64e18a33fb08571614a1..9de7e9caffa174c9052062419d7e74e4062fcd3f 100644 (file)
@@ -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);