]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
conf-parser: only read the first found main config file
authorMike Yuan <me@yhndnzj.com>
Wed, 22 Nov 2023 11:04:29 +0000 (19:04 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 22 Nov 2023 17:44:54 +0000 (17:44 +0000)
Follow-up for 93f1da45566d064f4f053b37bbac2813631f58b1
and 8ea288db018c7dfe0016d51d4538539bab4ab6de

Before the offending commits, we only read the first found
main config file. If the main config file is symlinked to/as
a drop-in, we should break instead of continuing, for it to
be read later.

src/shared/conf-parser.c

index 12312f550084695a3f341519db4e53e17d68f90c..59a529d4bcbf94b07988f85c77190ad081614edf 100644 (file)
@@ -557,7 +557,7 @@ static int config_parse_many_files(
 
                         if (set_contains(inodes, &st)) {
                                 log_debug("%s: symlink to/symlinked as drop-in, will be read later.", *fn);
-                                continue;
+                                break;
                         }
                 }
 
@@ -571,6 +571,8 @@ static int config_parse_many_files(
                         if (r < 0)
                                 return r;
                 }
+
+                break;
         }
 
         /* Then read all the drop-ins. */