diff options
author | Steve Dower <steve.dower@python.org> | 2019-06-24 15:42:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-24 15:42:54 (GMT) |
commit | 60419a7e96577cf783b3b45bf3984f9fb0d7ddff (patch) | |
tree | 2718cb915663c42902621491ba60accce6729d42 /Lib/shutil.py | |
parent | 9bbf4d7083a819cbcee2a6cd3df2802d4c50f734 (diff) | |
download | cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.zip cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.tar.gz cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.tar.bz2 |
bpo-37363: Add audit events for a range of modules (GH-14301)
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r-- | Lib/shutil.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index 6486cd6..ab1a7d6 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -530,6 +530,7 @@ def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, function that supports the same signature (like copy()) can be used. """ + sys.audit("shutil.copytree", src, dst) with os.scandir(src) as entries: return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks, ignore=ignore, copy_function=copy_function, @@ -640,6 +641,7 @@ def rmtree(path, ignore_errors=False, onerror=None): is false and onerror is None, an exception is raised. """ + sys.audit("shutil.rmtree", path) if ignore_errors: def onerror(*args): pass @@ -965,6 +967,7 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, 'owner' and 'group' are used when creating a tar archive. By default, uses the current owner and group. """ + sys.audit("shutil.make_archive", base_name, format, root_dir, base_dir) save_cwd = os.getcwd() if root_dir is not None: if logger is not None: |