diff --git a/src/basic/unit-file.c b/src/basic/unit-file.c index 618cf8b4897..d1e997ec9f2 100644 --- a/src/basic/unit-file.c +++ b/src/basic/unit-file.c @@ -284,7 +284,7 @@ int unit_file_build_name_map( continue; } - FOREACH_DIRENT(de, d, log_warning_errno(errno, "Failed to read \"%s\", ignoring: %m", *dir)) { + FOREACH_DIRENT_ALL(de, d, log_warning_errno(errno, "Failed to read \"%s\", ignoring: %m", *dir)) { char *filename; _unused_ _cleanup_free_ char *_filename_free = NULL; _cleanup_free_ char *simplified = NULL; diff --git a/test/units/testsuite-65.sh b/test/units/testsuite-65.sh index 6899c66ae63..95b18e5e235 100755 --- a/test/units/testsuite-65.sh +++ b/test/units/testsuite-65.sh @@ -68,6 +68,12 @@ cat </tmp/testfile.service ExecStart = echo hello EOF +# Prevent regression from #13380 and #20859 where we can't verify hidden files +cp /tmp/testfile.service /tmp/.testfile.service + +systemd-analyze verify /tmp/.testfile.service + +rm /tmp/.testfile.service # Zero exit status since the value used for comparison determine exposure to security threats is by default 100 systemd-analyze security --offline=true /tmp/testfile.service