stat-util: specify O_DIRECTORY when reopening dir in dir_is_empty_at()
authorLennart Poettering <lennart@poettering.net>
Thu, 21 Oct 2021 16:07:06 +0000 (18:07 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Nov 2021 14:01:29 +0000 (15:01 +0100)
commite1e32516f98a1f39ce763545de9a8664526d0b8a
tree7d98ca7a601f0de81d1f32f815b2c1d3bec9fd65
parent214ea3a26e9cc5dda8530a45a71b052e75a250a4
stat-util: specify O_DIRECTORY when reopening dir in dir_is_empty_at()

That way we can fail earlier if the specified fd is not actually a
directory.

(Also, it's not exactly according to standards to open things without
either O_RDONLY/O_RDWR...)

(cherry picked from commit b9d06522631a22d242374dc44a74c3b6459e3cb3)
src/basic/stat-util.c