diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-09-29 13:43:00 +0200 |
---|---|---|
committer | Chris Down <chris@chrisdown.name> | 2019-09-30 14:29:59 +0200 |
commit | 28e68bb23547cbc11cd3f62a1a38dbe2b387b370 (patch) | |
tree | 29fa75170fab7bf9e81d0e1e475348a076c0c794 /src/shared/unit-file.c | |
parent | test: allow use of nested KVM (diff) | |
download | systemd-28e68bb23547cbc11cd3f62a1a38dbe2b387b370.tar.xz systemd-28e68bb23547cbc11cd3f62a1a38dbe2b387b370.zip |
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
Diffstat (limited to 'src/shared/unit-file.c')
-rw-r--r-- | src/shared/unit-file.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/unit-file.c b/src/shared/unit-file.c index 4a5f23e6c1..c7a6d67172 100644 --- a/src/shared/unit-file.c +++ b/src/shared/unit-file.c @@ -279,6 +279,7 @@ int unit_file_build_name_map( if (hashmap_contains(ids, de->d_name)) continue; + dirent_ensure_type(d, de); if (de->d_type == DT_LNK) { /* We don't explicitly check for alias loops here. unit_ids_map_get() which * limits the number of hops should be used to access the map. */ |