From 7731fa5df8268a34507b4128c0cacbbf9603a3f0 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Tue, 11 Aug 2015 21:35:19 +0200 Subject: [PATCH] Add regexp for safe filenames, including slashes. --- daklib/regexes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daklib/regexes.py b/daklib/regexes.py index 6e00164c..86ca6a95 100644 --- a/daklib/regexes.py +++ b/daklib/regexes.py @@ -133,6 +133,9 @@ re_includeinpdiff = re.compile(r"(Translation-[a-zA-Z_]+\.(?:bz2|xz))") # Match safe filenames re_file_safe = re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_.~+-]*$') +# Match safe filenames, including slashes +re_file_safe_slash = re.compile(r'^[a-zA-Z0-9][/a-zA-Z0-9_.~+-]*$') + # Prefix of binary and source filenames _re_file_prefix = r'^(?P[a-z0-9][a-z0-9.+-]+)_(?P[A-Za-z0-9.~+-]+?)' -- 2.39.5