bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, `resource`, `shutil`, `signal`, `syslog` (GH-18407)
Co-authored-by: Saiyang Gou <gousaiyang@163.com>
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index 174b7e8..bd24de7 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -67,6 +67,8 @@
a new symbolic link will be created instead of copying the
file *src* points to.
+ .. audit-event:: shutil.copyfile src,dst shutil.copyfile
+
.. versionchanged:: 3.3
:exc:`IOError` used to be raised instead of :exc:`OSError`.
Added *follow_symlinks* argument.
@@ -101,6 +103,8 @@
:func:`copymode` cannot modify symbolic links on the local platform, and it
is asked to do so, it will do nothing and return.
+ .. audit-event:: shutil.copymode src,dst shutil.copymode
+
.. versionchanged:: 3.3
Added *follow_symlinks* argument.
@@ -146,6 +150,8 @@
Please see :data:`os.supports_follow_symlinks`
for more information.
+ .. audit-event:: shutil.copystat src,dst shutil.copystat
+
.. versionchanged:: 3.3
Added *follow_symlinks* argument and support for Linux extended attributes.
@@ -167,6 +173,10 @@
To preserve all file metadata from the original, use
:func:`~shutil.copy2` instead.
+ .. audit-event:: shutil.copyfile src,dst shutil.copy
+
+ .. audit-event:: shutil.copymode src,dst shutil.copy
+
.. versionchanged:: 3.3
Added *follow_symlinks* argument.
Now returns path to the newly created file.
@@ -194,6 +204,10 @@
Please see :func:`copystat` for more information
about platform support for modifying symbolic link metadata.
+ .. audit-event:: shutil.copyfile src,dst shutil.copy2
+
+ .. audit-event:: shutil.copystat src,dst shutil.copy2
+
.. versionchanged:: 3.3
Added *follow_symlinks* argument, try to copy extended
file system attributes too (currently Linux only).
@@ -342,6 +356,8 @@
*copy_function* allows the move to succeed when it is not possible to also
copy the metadata, at the expense of not copying any of the metadata.
+ .. audit-event:: shutil.move src,dst shutil.move
+
.. versionchanged:: 3.3
Added explicit symlink handling for foreign filesystems, thus adapting
it to the behavior of GNU's :program:`mv`.
@@ -378,6 +394,8 @@
See also :func:`os.chown`, the underlying function.
+ .. audit-event:: shutil.chown path,user,group shutil.chown
+
.. availability:: Unix.
.. versionadded:: 3.3
@@ -629,6 +647,8 @@
registered for that extension. In case none is found,
a :exc:`ValueError` is raised.
+ .. audit-event:: shutil.unpack_archive filename,extract_dir,format shutil.unpack_archive
+
.. versionchanged:: 3.7
Accepts a :term:`path-like object` for *filename* and *extract_dir*.