fix invalid use of access function in nftw
commit4bd22b8f3e6ffa8f43ea73e7bb6276aafb5a7743
authorRich Felker <dalias@aerifal.cx>
Mon, 15 Jun 2020 22:59:59 +0000 (15 18:59 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 15 Jun 2020 23:09:46 +0000 (15 19:09 -0400)
tree03503c03d8951ffcaa3e00b11c11d1ba34bab980
parentca36573ecfbbef7a1563aaa1a8486081f8c9fdda
fix invalid use of access function in nftw

access always computes result with real ids not effective ones, so it
is not a valid means of determining whether the directory is readable.
instead, attempt to open it before reporting whether it's readable,
and then use fdopendir rather than opendir to open and read the
entries.

effort is made here to keep fd_limit behavior the same as before even
if it was not correct.
src/misc/nftw.c