platform_external_selinux/policycoreutils
Alan Jenkins ac7899fc3a policycoreutils: let output of fixfiles be redirected (as normal)
fixfiles was redirecting log output to `tty`.  This overrides user intent
e.g. when shell redirection is used.

Redirect it to stdout, using /proc.  `tty` equally depended on /proc.
We do not depend on /dev/stdout: it might not be present, if a rescue
system is booted with devtmpfs (no udev daemon).

By default, log messages were redirected into the void when not run from a
tty.  We consider this a bug, which is now fixed.

1. If calling scripts happen to require the old behaviour, they can easily
   write the same code themselves.

2. When fixfiles is run from Fedora's selinux-autorelabel.service,
   the calling script is specifically run from a tty.

   Also Fedora's calling script chooses to redirect stdout and stderr to
   /dev/null.  This redirection will now suceed, improving the transparency
   of the code.  The previous behaviour may be obtained by choosing not
   to redirect the progress messages of this long-running process to
   /dev/null.  A patch has been submitted to Fedora to suggest this novel
   approach:  https://bugzilla.redhat.com/show_bug.cgi?id=1415674

Complete disclosure:

* Remove unused variable LOGGER.
* Fix logfiles containing spaces.

Disclaimer:

1. "Log" output may contain escape sequences (backspace?) e.g. in
   `fixfiles -l log.txt restore`.  This is not the usual understanding
   of a log file.

2.  For some reason, not all informative messages are sent to `-l` e.g.
   the list of filesystems, and "cleaning up labels on /tmp".

3. `function logit` is retained, but the logfile is also written to
   outside this function.  Implementing support for the system log
   would require another function which accepts piped input.
   Also see point 1.

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
2017-01-24 13:34:57 -05:00
..
.tx Update Translations 2013-10-24 13:58:39 -04:00
hll policycoreutils/hll/pp: Fix pp crash when processing base module 2017-01-19 12:30:21 -05:00
load_policy policycoreutils, python: Fix bad manpage formatting in "SEE ALSO" 2017-01-12 14:59:31 -05:00
man Merge branch 'fedora' into master-merge 2013-10-24 15:24:17 -04:00
newrole libsepol: use constant keys in hashtab functions 2017-01-19 08:46:19 -05:00
po sepolicy: update setup.py to remove C module 2016-09-23 16:33:49 -04:00
run_init policycoreutils, python: Fix bad manpage formatting in "SEE ALSO" 2017-01-12 14:59:31 -05:00
scripts policycoreutils: let output of fixfiles be redirected (as normal) 2017-01-24 13:34:57 -05:00
secon policycoreutils, python: Fix bad manpage formatting in "SEE ALSO" 2017-01-12 14:59:31 -05:00
semodule policycoreutils, python: Fix bad manpage formatting in "SEE ALSO" 2017-01-12 14:59:31 -05:00
sestatus Laurent Bigonville patch to fix various minor manpage issues and correct section numbering. 2013-10-24 13:58:37 -04:00
setfiles restorecon manpage: link back to fixfiles 2017-01-12 14:59:36 -05:00
setsebool libselinux, policycoreutils: Man page warning fixes 2015-11-24 16:32:13 -05:00
.gitignore Move policycoreutils/semodule_package to semodule-utils. 2016-11-16 11:19:51 -05:00
COPYING initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile Move policycoreutils/semodule_package to semodule-utils. 2016-11-16 11:19:51 -05:00
VERSION Update VERSION and ChangeLog files for 2.6 final release. 2016-10-14 11:31:26 -04:00