upstream: never close stdin
commitbc5dcb8ab9a4e8af54a724883732af378f42ea78
authortobias@openbsd.org <tobias@openbsd.org>
Tue, 30 Apr 2024 15:40:43 +0000 (30 15:40 +0000)
committerDamien Miller <djm@mindrot.org>
Wed, 8 May 2024 04:57:47 +0000 (8 14:57 +1000)
treea24fcba4944acf4a8f3d4ced20910709a995872e
parent6a42b70e56bef1aacdcdf06352396e837883e84f
upstream: never close stdin

The sanitise_stdfd call makes sure that standard file descriptors are
open (if they were closed, they are connected with /dev/null).

Do not close stdin in any case to prevent error messages when stdin is
read multiple times and to prevent later usage of fd 0 for connections,
e.g.

echo localhost | ssh-keyscan -f - -f -

While at it, make stdin-related error messages nicer.

Authored with Max Kunzelmann <maxdev at posteo dot de>

ok djm

OpenBSD-Commit-ID: 48e9b7938e2fa2f9bd47e6de6df66a31e0b375d3
ssh-keyscan.c