Skip to content

Commit

Permalink
SUIDPermissionsCheck: Escape path for regular expression
Browse files Browse the repository at this point in the history
  • Loading branch information
danigm committed Nov 8, 2024
1 parent 1b69a23 commit f535fdc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rpmlint/checks/SUIDPermissionsCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f535fdc

Please sign in to comment.