From 2dfd30384e7849c2f38717ead43ab42287b127c9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Jun 2021 10:09:34 -0700 Subject: [PATCH] s3: smbd: Allow is_visible_fsp() to cope with POSIX symlinks/MSDFS links. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/dir.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 70b61c8521f..034003e3caf 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -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 || -- 2.47.3