bpo-43762: Add audit events for loading of sqlite3 extensions (GH-25246)

This commit is contained in:
Erlend Egeberg Aasland 2021-04-27 01:16:46 +02:00 committed by GitHub
parent 52cd6d5e1b
commit 7244c0060d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 86 additions and 0 deletions

View file

@ -96,6 +96,14 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
}
result = PyObject_Call(factory, args, kwargs);
if (result == NULL) {
return NULL;
}
if (PySys_Audit("sqlite3.connect/handle", "O", self) < 0) {
Py_DECREF(result);
return NULL;
}
return result;
}