]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/unit-file: ignore any hidden files immediately
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 28 Apr 2021 13:57:40 +0000 (15:57 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 28 Apr 2021 15:12:32 +0000 (17:12 +0200)
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

index 50e6eccbf70ddbeb4007a4d829f1d78dcb5c106c..820b3984fdd87ef9d02ed2e872cce53cbe9cb52d 100644 (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;