mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05: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);
 | 
					          		err = get_device_list(uc_mgr, list, str);
 | 
				
			||||||
                else if (check_identifier(identifier, "_modifiers"))
 | 
					                else if (check_identifier(identifier, "_modifiers"))
 | 
				
			||||||
                        err = get_modifier_list(uc_mgr, list, str);
 | 
					                        err = get_modifier_list(uc_mgr, list, str);
 | 
				
			||||||
 | 
							else if (identifier[0] == '_')
 | 
				
			||||||
 | 
								err = -ENOENT;
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                        err = get_value_list(uc_mgr, identifier, list, str);
 | 
					                        err = get_value_list(uc_mgr, identifier, list, str);
 | 
				
			||||||
        	if (str)
 | 
					        	if (str)
 | 
				
			||||||
| 
						 | 
					@ -1159,6 +1161,9 @@ int snd_use_case_get(snd_use_case_mgr_t *uc_mgr,
 | 
				
			||||||
                        goto __end;
 | 
					                        goto __end;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
	        err = 0;
 | 
						        err = 0;
 | 
				
			||||||
 | 
						} else if (identifier[0] == '_') {
 | 
				
			||||||
 | 
							err = -ENOENT;
 | 
				
			||||||
 | 
							goto __end;
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
                str1 = strchr(identifier, '/');
 | 
					                str1 = strchr(identifier, '/');
 | 
				
			||||||
                if (str1) {
 | 
					                if (str1) {
 | 
				
			||||||
| 
						 | 
					@ -1247,8 +1252,16 @@ int snd_use_case_geti(snd_use_case_mgr_t *uc_mgr,
 | 
				
			||||||
				*value = err;
 | 
									*value = err;
 | 
				
			||||||
				err = 0;
 | 
									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
 | 
							} else
 | 
				
			||||||
                        err = -EINVAL;
 | 
					                        err = -ENOENT;
 | 
				
			||||||
                if (str)
 | 
					                if (str)
 | 
				
			||||||
                        free(str);
 | 
					                        free(str);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue