mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
conf: fix override directory order
We need to load and apply the overrides in the order: If absolute config path, use only that. If environment variable, use only that. Else /usr/share/pipewire/*.conf.d/ /etc/pipewire/*.conf.d/ $HOME/.config/pipewire/*.conf.d/ Before this patch we would first apply $HOME and then /etc and /usr, which is not expected.
This commit is contained in:
parent
791455c83f
commit
ffd9a8b892
1 changed files with 8 additions and 4 deletions
|
|
@ -162,6 +162,7 @@ no_config:
|
|||
static int get_config_dir(char *path, size_t size, const char *prefix, const char *name, int *level)
|
||||
{
|
||||
int res;
|
||||
bool no_config;
|
||||
|
||||
if (prefix == NULL) {
|
||||
prefix = name;
|
||||
|
|
@ -173,7 +174,8 @@ static int get_config_dir(char *path, size_t size, const char *prefix, const cha
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
if (pw_check_option("no-config", "true"))
|
||||
no_config = pw_check_option("no-config", "true");
|
||||
if (no_config)
|
||||
goto no_config;
|
||||
|
||||
if ((res = get_envconf_path(path, size, prefix, name)) != 0) {
|
||||
|
|
@ -183,9 +185,12 @@ static int get_config_dir(char *path, size_t size, const char *prefix, const cha
|
|||
}
|
||||
|
||||
if (*level == 0) {
|
||||
no_config:
|
||||
(*level)++;
|
||||
if ((res = get_homeconf_path(path, size, prefix, name)) != 0)
|
||||
if ((res = get_confdata_path(path, size, prefix, name)) != 0)
|
||||
return res;
|
||||
if (no_config)
|
||||
return 0;
|
||||
}
|
||||
if (*level == 1) {
|
||||
(*level)++;
|
||||
|
|
@ -193,9 +198,8 @@ static int get_config_dir(char *path, size_t size, const char *prefix, const cha
|
|||
return res;
|
||||
}
|
||||
if (*level == 2) {
|
||||
no_config:
|
||||
(*level)++;
|
||||
if ((res = get_confdata_path(path, size, prefix, name)) != 0)
|
||||
if ((res = get_homeconf_path(path, size, prefix, name)) != 0)
|
||||
return res;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue