From: Jeremy Allison Date: Fri, 4 Jun 2021 17:09:34 +0000 (-0700) Subject: s3: smbd: Allow is_visible_fsp() to cope with POSIX symlinks/MSDFS links. X-Git-Tag: tevent-0.11.0~569 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dfd30384e7849c2f38717ead43ab42287b127c9;p=thirdparty%2Fsamba.git s3: smbd: Allow is_visible_fsp() to cope with POSIX symlinks/MSDFS links. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- 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 ||