From f535fdcc3f2d532d93540dc7643046161c4f33fa Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno Date: Fri, 8 Nov 2024 13:51:42 +0100 Subject: [PATCH] SUIDPermissionsCheck: Escape path for regular expression See https://github.com/rpm-software-management/rpmlint/pull/1294#issuecomment-2464640941 --- rpmlint/checks/SUIDPermissionsCheck.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpmlint/checks/SUIDPermissionsCheck.py b/rpmlint/checks/SUIDPermissionsCheck.py index b7f5ee4c2..27159f1c9 100644 --- a/rpmlint/checks/SUIDPermissionsCheck.py +++ b/rpmlint/checks/SUIDPermissionsCheck.py @@ -60,7 +60,8 @@ def _check_post_scriptlets(self, pkg, path, need_verifyscript): if script: for line in script.split('\n'): - if re.search(fr'(chkstat|permctl) -n .* {path}', line): + escaped = re.escape(path) + if re.search(fr'(chkstat|permctl) -n .* {escaped}', line): found = True break