basic/unit-file: ignore any hidden files immediately

Hidden and backup files cannot be valid unit name (we reject anything
starting with a dot, and we require type suffixes). So let's not iterate
over those at all.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-04-28 15:57:40 +02:00
parent e6f1d7f4ec
commit 3796bdc55d

View file

@ -284,7 +284,7 @@ int unit_file_build_name_map(
continue;
}
FOREACH_DIRENT_ALL(de, d, log_warning_errno(errno, "Failed to read \"%s\", ignoring: %m", *dir)) {
FOREACH_DIRENT(de, d, log_warning_errno(errno, "Failed to read \"%s\", ignoring: %m", *dir)) {
char *filename;
_cleanup_free_ char *_filename_free = NULL, *simplified = NULL;
const char *suffix, *dst = NULL;