From: Ansgar Burchardt Date: Tue, 11 Aug 2015 19:35:19 +0000 (+0200) Subject: Add regexp for safe filenames, including slashes. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=7731fa5df8268a34507b4128c0cacbbf9603a3f0;p=dak.git Add regexp for safe filenames, including slashes. --- 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.~+-]+?)'