]> git.ipfire.org Git - thirdparty/coreutils.git/commit
nice, nohup, su: detect write failure to stderr
authorEric Blake <ebb9@byu.net>
Wed, 28 Oct 2009 20:36:09 +0000 (14:36 -0600)
committerEric Blake <ebb9@byu.net>
Thu, 29 Oct 2009 03:12:41 +0000 (21:12 -0600)
commit1c59bb3cefff73c532033863e60e9130892a50dd
tree42f89ad649d5be625ac200f044c3f7acd5ee5e08
parent536a1fbe5ff47078d515a41ea4b45c4e0d794da2
nice, nohup, su: detect write failure to stderr

These programs can print non-fatal diagnostics to stderr prior to
exec'ing a subsidiary program.  However, if we thought the situation
warranted a diagnostic, we insist that the diagnostic be printed
without error, rather than blindly exec, as it may be a security risk.

For an example, try 'nice -n -1 nice 2>/dev/full'.  Failure to raise
priority (by lowering niceness) is not fatal, but failure to inform
the user about failure to change priority is dangerous.

* src/nice.c (main): Declare failure if writing advisory message
to stderr fails.
* src/nohup.c (main): Likewise.
* src/su.c (main): Likewise.
* tests/misc/nice: Test this.
* tests/misc/nohup: Likewise.
* NEWS: Document this.
NEWS
src/nice.c
src/nohup.c
src/su.c
tests/misc/nice
tests/misc/nohup