diff options
| author | Steve Dower <steve.dower@python.org> | 2019-06-24 15:42:54 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-24 15:42:54 (GMT) |
| commit | 60419a7e96577cf783b3b45bf3984f9fb0d7ddff (patch) | |
| tree | 2718cb915663c42902621491ba60accce6729d42 /Modules | |
| parent | 9bbf4d7083a819cbcee2a6cd3df2802d4c50f734 (diff) | |
| download | cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.zip cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.tar.gz cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.tar.bz2 | |
bpo-37363: Add audit events for a range of modules (GH-14301)
Diffstat (limited to 'Modules')
| -rw-r--r-- | Modules/_sqlite/module.c | 4 | ||||
| -rw-r--r-- | Modules/posixmodule.c | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index c487ba9..9fe0dc9 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -85,6 +85,10 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject* factory = (PyObject*)&pysqlite_ConnectionType; } + if (PySys_Audit("sqlite3.connect", "O", database) < 0) { + return NULL; + } + result = PyObject_Call(factory, args, kwargs); return result; diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index dff6309..b2fd45b 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -3759,6 +3759,10 @@ static PyObject * os_listdir_impl(PyObject *module, path_t *path) /*[clinic end generated code: output=293045673fcd1a75 input=e3f58030f538295d]*/ { + if (PySys_Audit("os.listdir", "O", + path->object ? path->object : Py_None) < 0) { + return NULL; + } #if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR) return _listdir_windows_no_opendir(path, NULL); #else @@ -13164,6 +13168,11 @@ os_scandir_impl(PyObject *module, path_t *path) #endif #endif + if (PySys_Audit("os.scandir", "O", + path->object ? path->object : Py_None) < 0) { + return NULL; + } + iterator = PyObject_New(ScandirIterator, &ScandirIteratorType); if (!iterator) return NULL; |
