Skip to content

Commit

Permalink
selinux: use text processing for audit.log
Browse files Browse the repository at this point in the history
We ran into some odd grep bug treating the audit.log as binary and
wrongly returning a match result.

Fixes: https://tracker.ceph.com/issues/43797
Signed-off-by: Patrick Donnelly <[email protected]>
  • Loading branch information
batrick committed Jan 23, 2020
1 parent cae3b6e commit 98580ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions teuthology/task/selinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def get_denials(self):
ignore_known_denials = '\'\(' + str.join('\|', known_denials) + '\)\''
for remote in self.cluster.remotes.keys():
proc = remote.run(
args=['sudo', 'grep', 'avc: .*denied',
'/var/log/audit/audit.log', run.Raw('|'), 'grep', '-v',
args=['sudo', 'grep', '-a', 'avc: .*denied',
'/var/log/audit/audit.log', run.Raw('|'), 'grep', '-av',
run.Raw(ignore_known_denials)],
stdout=StringIO(),
check_status=False,
Expand Down

0 comments on commit 98580ec

Please sign in to comment.