elfdump: limit STDIN to no rights rather than closing it
authoremaste <emaste@FreeBSD.org>
Tue, 20 Sep 2016 21:38:12 +0000 (21:38 +0000)
committeremaste <emaste@FreeBSD.org>
Tue, 20 Sep 2016 21:38:12 +0000 (21:38 +0000)
commit7a9a0e3b3b0ef95e1a8d2dd70b7be3ac6f6b2f46
tree8869db165072da6609963e04828d734deaa895f7
parentdf343ad2c22ac5702463b6f9f13e95808381e2b7
elfdump: limit STDIN to no rights rather than closing it

Closing stdin/stdout/stderr is often a bad idea as a future open()
can end up with its fd. Leave it open and limit it to no rights
instead.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D7984
usr.bin/elfdump/elfdump.c