gh-107954: Add audit event to PyConfig_Set() (#132958)

This commit is contained in:
Victor Stinner 2025-04-25 18:30:39 +02:00 committed by GitHub
parent 070d866567
commit ac5424d6a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -4539,6 +4539,10 @@ config_set_int_attr(const PyConfigSpec *spec, int value)
int
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);
if (spec == NULL) {
spec = preconfig_find_spec(name);