gh-135543: Emit sys.remote_exec audit event when sys.remote_exec is called (GH-135544)

This commit is contained in:
Nadeshiko Manju 2025-06-20 04:23:38 +08:00 committed by GitHub
parent bb9596fcfa
commit 1ddfe59320
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 79 additions and 20 deletions

View file

@ -2488,6 +2488,11 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
if (PyUnicode_FSConverter(script, &path) == 0) {
return NULL;
}
if (PySys_Audit("sys.remote_exec", "iO", pid, script) < 0) {
return NULL;
}
debugger_script_path = PyBytes_AS_STRING(path);
#ifdef MS_WINDOWS
PyObject *unicode_path;