From a98b42246fc9996a84e5cb221f33bbd724ffcb45 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sat, 1 Jun 2024 20:11:05 -0400 Subject: [PATCH] Permit any printable ASCII character in files/ GLEP 33 says files/ entries should be within the ASCII range. PMS does not make any further restrictions. One immediate benefit: this will allow for systemd template units to be stored in files/ without mangling the filename. For example: BannedCharacter: filename 'files/foo@.service' character outside allowed set: '@' Signed-off-by: Mike Gilbert --- src/pkgcheck/checks/pkgdir.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pkgcheck/checks/pkgdir.py b/src/pkgcheck/checks/pkgdir.py index ef90baac5..68fc4c268 100644 --- a/src/pkgcheck/checks/pkgdir.py +++ b/src/pkgcheck/checks/pkgdir.py @@ -19,6 +19,9 @@ allowed_filename_chars.update(chr(x) for x in range(ord("0"), ord("9") + 1)) allowed_filename_chars.update([".", "-", "_", "+", ":"]) +# allow any printable ascii character in FILESDIR +allowed_filesdir_chars = set(chr(x) for x in range(33, 127)) + class MismatchedPN(results.PackageResult, results.Error): """Ebuilds that have different names than their parent directory.""" @@ -289,7 +292,7 @@ def feed(self, pkgset): yield SizeViolation( pjoin(base_dir, filename), file_stat.st_size, pkg=pkg ) - if banned_chars := set(filename) - allowed_filename_chars: + if banned_chars := set(filename) - allowed_filesdir_chars: yield BannedCharacter( pjoin(base_dir, filename), sorted(banned_chars), pkg=pkg )