]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Allow is_visible_fsp() to cope with POSIX symlinks/MSDFS links.
authorJeremy Allison <jra@samba.org>
Fri, 4 Jun 2021 17:09:34 +0000 (10:09 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:30 +0000 (13:14 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/dir.c

index 70b61c8521f845bcdf52093dcc44a3e005da407b..034003e3caf70bef59ef1701af4af58c4a82c72b 100644 (file)
@@ -1612,6 +1612,24 @@ bool is_visible_fsp(struct files_struct *fsp, bool use_veto)
                return false;
        }
 
+       if (fsp_get_pathref_fd(fsp) == -1) {
+               /*
+                * Symlink in POSIX mode or MS-DFS.
+                * We've checked veto files so the
+                * only thing we can check is the
+                * hide_new_files_timeout.
+                */
+               if (hide_new_files_timeout != 0) {
+                       double age = timespec_elapsed(
+                               &fsp->fsp_name->st.st_ex_mtime);
+
+                       if (age < (double)hide_new_files_timeout) {
+                               return false;
+                       }
+               }
+               return true;
+       }
+
        if (hide_unreadable ||
            hide_unwriteable ||
            hide_special ||