mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-37363: Add audit events for a range of modules (GH-14301)
This commit is contained in:
parent
9bbf4d7083
commit
60419a7e96
37 changed files with 165 additions and 18 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue