path-lookup: Correct order of XDG_CONFIG_HOME and XDG_CONFIG_DIRS

According to the XDG Base Directory Specification [1] XDG_CONFIG_HOME
should take precedence over XDG_CONFIG_DIRS.

Fixes: https://github.com/systemd/systemd/issues/16095

[1]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
This commit is contained in:
Pass Automated Testing Suite
2020-09-29 21:47:01 +02:00
committed by Lennart Poettering
parent f856778b9c
commit e3820eeaf1
2 changed files with 14 additions and 4 deletions
+2 -2
View File
@@ -181,10 +181,10 @@ static char** user_dirs(
if (strv_extend(&res, generator_early) < 0)
return NULL;
if (strv_extend_strv_concat(&res, config_dirs, "/systemd/user") < 0)
if (strv_extend(&res, persistent_config) < 0)
return NULL;
if (strv_extend(&res, persistent_config) < 0)
if (strv_extend_strv_concat(&res, config_dirs, "/systemd/user") < 0)
return NULL;
/* global config has lower priority than the user config of the same type */