Skip to content

Commit a90a532

Browse files
authored
Merge pull request #1324 from scabrero/fix-permctl-verifyscript
SUIDPermissionsCheck: Check for permctl instead of chkstat
2 parents 2bcb1b9 + e950414 commit a90a532

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

rpmlint/checks/SUIDPermissionsCheck.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def _check_post_scriptlets(self, pkg, path, need_verifyscript):
8181
found = False
8282
if script:
8383
for line in script.split('\n'):
84-
if '/chkstat' in line and path in line:
84+
escaped = re.escape(path)
85+
if re.search(fr'(chkstat|permctl) -n .* {escaped}', line):
8586
found = True
8687
break
8788

test/test_suid_permissions.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ def test_permissions_d(tmp_path, package, permissions_check):
155155
if [ -x /usr/bin/permctl ]; then \
156156
/usr/bin/permctl -n --set --system /var/lib/perms/test || : \
157157
fi \
158+
""",
159+
'VERIFYSCRIPT': """
160+
if [ -x /usr/bin/permctl ]; then \
161+
/usr/bin/permctl -n --set --system /var/lib/perms/test || : \
162+
fi \
158163
""",
159164
},
160165
)
@@ -164,6 +169,11 @@ def test_permissions_d(tmp_path, package, permissions_check):
164169
if [ -x /usr/bin/chkstat ]; then \
165170
/usr/bin/chkstat -n --set --system /var/lib/perms/test || : \
166171
fi \
172+
""",
173+
'VERIFYSCRIPT': """
174+
if [ -x /usr/bin/chkstat ]; then \
175+
/usr/bin/chkstat -n --set --system /var/lib/perms/test || : \
176+
fi \
167177
""",
168178
},
169179
)
@@ -175,3 +185,4 @@ def test_permissions_permctl(package, permissions_check):
175185
test.check(package)
176186
out = output.print_results(output.results)
177187
assert 'permissions-missing-postin' not in out
188+
assert 'permissions-missing-verifyscript' not in out

0 commit comments

Comments
 (0)