From 3796bdc55d6ba499d1049f749072218879e619a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 28 Apr 2021 15:57:40 +0200 Subject: [PATCH] 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. --- src/basic/unit-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3