[sos-devel] [PATCH] plugins/selinux: fixfiles produces no useful output, use restorecon

Bryn M. Reeves bmr at redhat.com
Tue Jan 13 14:43:05 UTC 2015


On Tue, Jan 13, 2015 at 02:22:23PM +0000, John Haxby wrote:
> diff --git a/sos/plugins/selinux.py b/sos/plugins/selinux.py
> index c914a9b..117ea06 100644
> --- a/sos/plugins/selinux.py
> +++ b/sos/plugins/selinux.py
> @@ -39,7 +39,7 @@ class SELinux(Plugin, RedHatPlugin):
>              "ps axuZww"
>          ])
>          if self.get_option('fixfiles'):
> -            self.add_cmd_output("fixfiles -v check")
> +            self.add_cmd_output("restorecon -Rvn / 2>/dev/null")

We no longer run commands with a shell so the redirect syntax here
won't work:

  commit 46b6c3d39f923d19fa7fcfec96c1cf2d23c768be
  Author: Bryn M. Reeves <bmr at redhat.com>
  Date:   Sun Apr 6 18:01:33 2014 +0100

    Call Popen with shell=False
    
    Fixes Issue #253.
    
    Signed-off-by: Bryn M. Reeves <bmr at redhat.com>

Including stderr here shouldn't be a problem (it's trivial to
filter on the analysis side) or alternatively a fix for Issue #267
would allow the stderr content to be discarded directly from the
Plugin.add_cmd_output() call:

  https://github.com/sosreport/sos/issues/267

#267 should be a straightforward feature - it's just been low down
on the priority list.

Regards,
Bryn.




More information about the sos-devel mailing list