From 98580ec2edf36de141134847a3d1138cf1b8e9f6 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Thu, 23 Jan 2020 15:20:52 -0800 Subject: [PATCH] selinux: use text processing for audit.log 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 --- teuthology/task/selinux.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teuthology/task/selinux.py b/teuthology/task/selinux.py index 6884edcb76..bf699f63df 100644 --- a/teuthology/task/selinux.py +++ b/teuthology/task/selinux.py @@ -137,8 +137,8 @@ class SELinux(Task): 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, -- 2.39.5