From 37164f010e50c0d39f1510ad2b221be91c81d673 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Fri, 20 Jun 2014 11:01:08 +0100 Subject: [PATCH 1/4] [selinux] pass --input-logs when calling ausearch If ausearch is run without a tty it expects log data to be fed on stdin. This causes the selinux plugin to appear to hang when run e.g. over an ssh session. Force the command to use the logs defined in auditd.conf by specifying --input-logs. Signed-off-by: Bryn M. Reeves Conflicts: sos/plugins/selinux.py --- sos/plugins/selinux.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sos/plugins/selinux.py b/sos/plugins/selinux.py index 7f93023..997f7a0 100644 --- a/sos/plugins/selinux.py +++ b/sos/plugins/selinux.py @@ -18,17 +18,16 @@ class selinux(sos.plugintools.PluginBase): """selinux related information """ optionList = [("fixfiles", 'Print incorrect file context labels', 'slow', False), - ("list", 'List objects and their context', 'slow', False)] + ("list", 'List objects and their context', 'slow', False)] packages = ('libselinux', 'policycoreutils-python') def setup(self): - # sestatus is always collected in check_enabled() self.addCopySpec("/etc/selinux") self.collectExtOutput("sestatus -b") self.collectExtOutput("semodule -l") self.collectExtOutput("selinuxdefcon root") self.collectExtOutput("selinuxconlist root") - self.collectExtOutput("ausearch -m avc,user_avc -ts today") + self.collectExtOutput("ausearch --input-logs -m avc,user_avc -ts today") self.collectExtOutput("semanage -o -") if self.getOption('fixfiles'): self.collectExtOutput("fixfiles check") @@ -37,4 +36,4 @@ class selinux(sos.plugintools.PluginBase): self.collectExtOutput("semanage user -l") self.collectExtOutput("semanage login -l") self.collectExtOutput("semanage port -l") - + -- 1.9.3