bpo-39184: Add audit events to command execution functions in os and pty modules (GH-17824)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index f59423c..bfc0322 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -3314,6 +3314,8 @@
you can check whether or not it is available using :data:`os.supports_fd`.
If it is unavailable, using it will raise a :exc:`NotImplementedError`.
+ .. audit-event:: os.exec path,args,env os.execl
+
.. availability:: Unix, Windows.
.. versionadded:: 3.3
@@ -3670,6 +3672,8 @@
:c:data:`POSIX_SPAWN_SETSCHEDPARAM` and :c:data:`POSIX_SPAWN_SETSCHEDULER`
flags.
+ .. audit-event:: os.posix_spawn path,argv,env os.posix_spawn
+
.. versionadded:: 3.8
.. availability:: Unix.
@@ -3684,6 +3688,8 @@
for the *executable* file in the list of directories specified by the
:envvar:`PATH` environment variable (in the same way as for ``execvp(3)``).
+ .. audit-event:: os.posix_spawn path,argv,env os.posix_spawnp
+
.. versionadded:: 3.8
.. availability:: See :func:`posix_spawn` documentation.
@@ -3784,6 +3790,8 @@
L = ['cp', 'index.html', '/dev/null']
os.spawnvpe(os.P_WAIT, 'cp', L, os.environ)
+ .. audit-event:: os.spawn mode,path,args,env os.spawnl
+
.. availability:: Unix, Windows. :func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp`
and :func:`spawnvpe` are not available on Windows. :func:`spawnle` and
:func:`spawnve` are not thread-safe on Windows; we advise you to use the
@@ -3853,6 +3861,8 @@
function is not resolved until this function is first called. If the function
cannot be resolved, :exc:`NotImplementedError` will be raised.
+ .. audit-event:: os.startfile path,operation os.startfile
+
.. availability:: Windows.