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
This commit is contained in:
committed by
Chris Down
parent
501deda1ce
commit
28e68bb235
@@ -475,6 +475,7 @@ static int boot_entries_find_unified(
|
||||
_cleanup_free_ char *j = NULL, *osrelease = NULL, *cmdline = NULL;
|
||||
_cleanup_close_ int fd = -1;
|
||||
|
||||
dirent_ensure_type(d, de);
|
||||
if (!dirent_is_file(de))
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user