Handle d_type == DT_UNKNOWN correctly
authorMichael Olbrich <m.olbrich@pengutronix.de>
Sun, 29 Sep 2019 11:43:00 +0000 (13:43 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 10 Oct 2019 12:47:01 +0000 (14:47 +0200)
commit5c0224c7bf3c4b0f18d44ee9da7e058833b1d8e2
tree362ba7773aedb5dee02a19be76fa9a2172c102b0
parent8282bc61df10dc1f2290c9c351d5ff6fdb157c24
Handle d_type == DT_UNKNOWN correctly

As documented in the man-page, readdir() may return a directory entry with
d_type == DT_UNKNOWN. This must be handled for regular filesystems.

dirent_ensure_type() is available to set d_type if necessary. Use it in
some more places.

Without this systemd will fail to boot correctly with nfsroot and some
other filesystems.

Closes #13609

(cherry picked from commit 28e68bb23547cbc11cd3f62a1a38dbe2b387b370)
src/core/smack-setup.c
src/login/logind-dbus.c
src/login/logind.c
src/shared/bootspec.c
src/shared/unit-file.c