From c1712c882ccfbfd4d101d59b414e5f30ec52bb78 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Fri, 28 Feb 2025 23:20:46 +0100 Subject: [PATCH] Expand nested (...) in glob_pattern This duplicates a few bytes, but makes the regex easier to read. --- utils/apparmor/rule/mount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/apparmor/rule/mount.py b/utils/apparmor/rule/mount.py index dd09ad24d..d16ef3b4c 100644 --- a/utils/apparmor/rule/mount.py +++ b/utils/apparmor/rule/mount.py @@ -66,7 +66,7 @@ mount_condition_pattern = rf'({fs_type_pattern})?\s*({option_pattern})?' # - A path : /foo # - A globbed Path : ** -glob_pattern = r'(\s*(?P<%s>(([/{]|\*\*)\S*|"([/{]|\*\*)[^"]*"|@{\S+}\S*|"@{\S+}[^"]*"|"")|\w+))' +glob_pattern = r'(\s*(?P<%s>([/{]\S*|\*\*\S*|"[/{][^"]*"|\*\*[^"]*"|@{\S+}\S*|"@{\S+}[^"]*"|"")|\w+))' source_fileglob_pattern = glob_pattern % 'source_file' dest_fileglob_pattern = glob_pattern % 'dest_file'