Add ausearch and semange customisations to SELinux plug-in

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Rename Plugin.get_cmd_dir() to get_cmd_path()

The method to retrieve the path into which a plug-in's collected
command output returns a path as a string rather than a directory
object.

Make this clear by renaming the method to 'get_cmd_path()'.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Add Plugin method to create new command output directories

Some plug-ins want to store command output in subdirectories of
their 'sos_commands/<plugin>/' directory. Currently there are
various hand-rolled methods to build this in different plug-ins.

Add a single method to the base Plugin class that builds the
correct path string and recursively creates the directories via
os.makedirs() in a single step.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Add Plugin method to build command output paths

Add a convenience method to construct an absolute path for
command output from a relative path or file name. This can be
used for e.g. to pass an output path to an external program that
produces output at a named path rather than on stdout and can be
used internally by the Plugin.make_cmd_dirs() method.

Convert the SELinux plug-in to use the new method when passing
output paths to the semanage command.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Make semange use stdout instead of output path

The semanage tool fails to write to a path within the temporary
report tree on some distributions due to an SELinux AVC denial.

Force the command to write data to stdout instead by passing
'-o -'.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>