smbd: Rewrite smbd_dirptr_get_entry()
authorVolker Lendecke <vl@samba.org>
Thu, 22 Jun 2023 13:12:25 +0000 (15:12 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 30 Jun 2023 10:42:36 +0000 (10:42 +0000)
commit88f32b783c43573ec3e2a82a640ad082e996aae2
tree1c4a5f84a1a039530c86c4d5c3a6aeb4165b87a3
parente9040fa42a5539c8bdbf41bd99db74759e966e88
smbd: Rewrite smbd_dirptr_get_entry()

Move filtering of entries, in particular symlinks, fully into
smbd_dirptr_get_entry(). Before, this was hidden in magic code inside
openat_pathref_fsp() and the mode_fn()s. Changing anything file open
code led to changes in very distant code paths because of unforeseen
consequences to directory listing. This change centralizes the
decision what directory entries to show into
smbd_dirptr_get_entry(). It uses openat_pathref_fsp_nosymlink()
without any symlink magic. It might need some tweaking when we also
want to show other special files, but this will hopefully be easier.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/dir.c
source3/smbd/smb1_reply.c
source3/smbd/smb2_trans2.c