]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43756: Add new audit event for new arguments added to glob.glob (GH-25239)
authorSaiyang Gou <gousaiyang@163.com>
Wed, 21 Apr 2021 22:42:55 +0000 (15:42 -0700)
committerGitHub <noreply@github.com>
Wed, 21 Apr 2021 22:42:55 +0000 (23:42 +0100)
Doc/library/glob.rst
Lib/glob.py
Misc/NEWS.d/next/Security/2021-04-06-18-07-48.bpo-43756.DLBNqQ.rst [new file with mode: 0644]

index 3fdba6937c1de0ff931374fe6a2a86b621938cdf..215f60d328c76a5a5620b4a240a3f7445ce458af 100644 (file)
@@ -65,6 +65,7 @@ For example, ``'[?]'`` matches the character ``'?'``.
    match.
 
    .. audit-event:: glob.glob pathname,recursive glob.glob
+   .. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.glob
 
    .. note::
       Using the "``**``" pattern in large directory trees may consume
@@ -83,6 +84,13 @@ For example, ``'[?]'`` matches the character ``'?'``.
    without actually storing them all simultaneously.
 
    .. audit-event:: glob.glob pathname,recursive glob.iglob
+   .. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.iglob
+
+   .. versionchanged:: 3.5
+      Support for recursive globs using "``**``".
+
+   .. versionchanged:: 3.10
+      Added the *root_dir* and *dir_fd* parameters.
 
 
 .. function:: escape(pathname)
@@ -128,4 +136,3 @@ default. For example, consider a directory containing :file:`card.gif` and
 
    Module :mod:`fnmatch`
       Shell-style filename (not path) expansion
-
index a491363f3f9395e412d4b3b72877b9cc4518e222..a6cff873508266c61ca6eeed4d70f2c3e56a65aa 100644 (file)
@@ -34,6 +34,7 @@ def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False):
     zero or more directories and subdirectories.
     """
     sys.audit("glob.glob", pathname, recursive)
+    sys.audit("glob.glob/2", pathname, recursive, root_dir, dir_fd)
     if root_dir is not None:
         root_dir = os.fspath(root_dir)
     else:
diff --git a/Misc/NEWS.d/next/Security/2021-04-06-18-07-48.bpo-43756.DLBNqQ.rst b/Misc/NEWS.d/next/Security/2021-04-06-18-07-48.bpo-43756.DLBNqQ.rst
new file mode 100644 (file)
index 0000000..e05fef2
--- /dev/null
@@ -0,0 +1,2 @@
+Add new audit event ``glob.glob/2`` to incorporate the new *root_dir* and
+*dir_fd* arguments added to :func:`glob.glob` and :func:`glob.iglob`.