mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-01 22:58:49 -04:00
UCM: Disallow gets of undefined system properties
In UCM, there are various system-defined properties whose names start with "_". Explicitly prevent any gets from falling back to properties defined in a config file if the property name starts with "_", in order to reserve the entire "_" namespace for system-defined properties. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
fc038149c5
commit
547300fb35
1 changed files with 14 additions and 1 deletions
|
|
@ -1032,6 +1032,8 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr,
|
|||
err = get_device_list(uc_mgr, list, str);
|
||||
else if (check_identifier(identifier, "_modifiers"))
|
||||
err = get_modifier_list(uc_mgr, list, str);
|
||||
else if (identifier[0] == '_')
|
||||
err = -ENOENT;
|
||||
else
|
||||
err = get_value_list(uc_mgr, identifier, list, str);
|
||||
if (str)
|
||||
|
|
@ -1159,6 +1161,9 @@ int snd_use_case_get(snd_use_case_mgr_t *uc_mgr,
|
|||
goto __end;
|
||||
}
|
||||
err = 0;
|
||||
} else if (identifier[0] == '_') {
|
||||
err = -ENOENT;
|
||||
goto __end;
|
||||
} else {
|
||||
str1 = strchr(identifier, '/');
|
||||
if (str1) {
|
||||
|
|
@ -1247,8 +1252,16 @@ int snd_use_case_geti(snd_use_case_mgr_t *uc_mgr,
|
|||
*value = err;
|
||||
err = 0;
|
||||
}
|
||||
#if 0
|
||||
/*
|
||||
* enable this block if the else clause below is expanded to query
|
||||
* user-supplied values
|
||||
*/
|
||||
} else if (identifier[0] == '_')
|
||||
err = -ENOENT;
|
||||
#endif
|
||||
} else
|
||||
err = -EINVAL;
|
||||
err = -ENOENT;
|
||||
if (str)
|
||||
free(str);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue