s3: VFS: shadow_copy2: In shadow_copy2_get_shadow_copy_data(), check for DIR_LIST...
authorJeremy Allison <jra@samba.org>
Mon, 7 Jun 2021 16:47:26 +0000 (09:47 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:30 +0000 (13:14 +0000)
commit342a0c92c98927ecd5e5983c72960aad07986137
tree84a50837e8ead81fa3648d71419d01347f580977
parentb56fc4b0d8e7b0ae327802a66c7c0526acf51cac
s3: VFS: shadow_copy2: In shadow_copy2_get_shadow_copy_data(), check for DIR_LIST access once we already have a handle on the snap directory.

There's no sense in opening a synthetic pathref first in
order to check for DIR_LIST access, then open again to
do the SMB_VFS_NEXT_FDOPENDIR() for listing.

Just open once, and check for DIR_LIST access on the
open handle before calling SMB_VFS_NEXT_FDOPENDIR() for listing.

We no longer need check_access_snapdir(), which is
static, so comment it out. Removal next.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_shadow_copy2.c