diff --git a/man/sysctl.d.xml b/man/sysctl.d.xml index 759b8740f..a5868e638 100644 --- a/man/sysctl.d.xml +++ b/man/sysctl.d.xml @@ -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. If the administrator wants to disable a diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index db18dd9f6..2735127a7 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -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;