mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	gh-107954: Add audit event to PyConfig_Set() (#132958)
This commit is contained in:
		
							parent
							
								
									070d866567
								
							
						
					
					
						commit
						ac5424d6a9
					
				
					 2 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -619,6 +619,8 @@ Some options are read from the :mod:`sys` attributes. For example, the option
 | 
				
			||||||
   The caller must have an :term:`attached thread state`. The function cannot
 | 
					   The caller must have an :term:`attached thread state`. The function cannot
 | 
				
			||||||
   be called before Python initialization nor after Python finalization.
 | 
					   be called before Python initialization nor after Python finalization.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   .. audit-event:: cpython.PyConfig_Set name,value c.PyConfig_Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   .. versionadded:: 3.14
 | 
					   .. versionadded:: 3.14
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4539,6 +4539,10 @@ config_set_int_attr(const PyConfigSpec *spec, int value)
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
PyConfig_Set(const char *name, PyObject *value)
 | 
					PyConfig_Set(const char *name, PyObject *value)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (PySys_Audit("cpython.PyConfig_Set", "sO", name, value) < 0) {
 | 
				
			||||||
 | 
					        return -1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const PyConfigSpec *spec = config_find_spec(name);
 | 
					    const PyConfigSpec *spec = config_find_spec(name);
 | 
				
			||||||
    if (spec == NULL) {
 | 
					    if (spec == NULL) {
 | 
				
			||||||
        spec = preconfig_find_spec(name);
 | 
					        spec = preconfig_find_spec(name);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue