gh-121957: Emit audit events for python -i and python -m asyncio (GH-121958)

Relatedly, emit the `cpython.run_startup` event from the Python version of
`PYTHONSTARTUP` handling.
This commit is contained in:
Łukasz Langa 2024-07-22 13:04:08 +02:00 committed by GitHub
parent cad11a2bdc
commit dc93d1125f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 36 additions and 2 deletions

View file

@ -594,6 +594,10 @@ pymain_repl(PyConfig *config, int *exitcode)
return;
}
if (PySys_Audit("cpython.run_stdin", NULL) < 0) {
return;
}
if (!isatty(fileno(stdin))
|| _Py_GetEnv(config->use_environment, "PYTHON_BASIC_REPL")) {
PyCompilerFlags cf = _PyCompilerFlags_INIT;