From: Zbigniew Jędrzejewski-Szmek Date: Wed, 28 Apr 2021 13:57:40 +0000 (+0200) Subject: basic/unit-file: ignore any hidden files immediately X-Git-Tag: v249-rc1~301^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3796bdc55d6ba499d1049f749072218879e619a7;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/basic/unit-file.c b/src/basic/unit-file.c index 50e6eccbf70..820b3984fdd 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_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;