This is used in a hot codepath (directory enumeration) so we should avoiding the
string comparisions by adding an early exit.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 3 17:33:00 UTC 2021 on sn-devel-184
hide_special = lp_hide_special_files(SNUM(fsp->conn));
hide_new_files_timeout = lp_hide_new_files_timeout(SNUM(fsp->conn));
+ if (!hide_unreadable &&
+ !hide_unwriteable &&
+ !hide_special &&
+ (hide_new_files_timeout == 0))
+ {
+ return true;
+ }
+
if (fsp->base_fsp != NULL) {
/* Only operate on non-stream files. */
fsp = fsp->base_fsp;