(F18) sysctl: give files with later names precedence over earlier ones

This restores the sysctl.d precedence rules of v197.
This commit is contained in:
Michal Schmidt
2013-05-03 17:08:55 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent cb5ec34519
commit e52f3bf8e7
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -92,7 +92,7 @@
alphabetical order, regardless in which of the
directories they reside, to guarantee that a specific
configuration file takes precedence over another file
with an alphabetically later name, if both files
with an alphabetically earlier name, if both files
contain the same variable setting.</para>
<para>If the administrator wants to disable a
+3 -1
View File
@@ -306,7 +306,9 @@ int main(int argc, char *argv[]) {
r = parse_file(sysctl_options, "/etc/sysctl.conf", true);
STRV_FOREACH(f, files) {
/* F18: iterate backwards to preserve v197's behaviour */
f = files + strv_length(files) - 1;
STRV_FOREACH_BACKWARDS(f, files) {
k = parse_file(sysctl_options, *f, true);
if (k < 0 && r == 0)
r = k;