vfs_gpfs: Use O_PATH for opening dirfd for stat with CAP_DAC_OVERRIDE
authorChristof Schmitt <cs@samba.org>
Thu, 26 Oct 2023 21:37:15 +0000 (14:37 -0700)
committerJule Anger <janger@samba.org>
Sat, 25 Nov 2023 18:27:15 +0000 (18:27 +0000)
commit982490858957956c2213f37806a8cec70e01df00
tree06cf34e49e6695dfa8369b3fe644e3d0ff17f8eb
parentb6c13c49153a4de962f14fd03537eb8afe9c8961
vfs_gpfs: Use O_PATH for opening dirfd for stat with CAP_DAC_OVERRIDE

Use O_PATH when available; this avoids the need for READ/LIST access on
that directory. Keep using O_RDONLY if the system does not have O_PATH.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15507

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit b317622a8fed0ee195ffe40129eb5bcad28dd985)
source3/modules/vfs_gpfs.c