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:28:13 +0000 (18:28 +0000)
commit71bf59691f54348dc4125989ac51a9c47ff80d43
tree8998079f765f86808f2251a4febec69d7ea07fde
parentd522d15c82bc413fcc83106c93fd3f051a04f270
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