fseek to end of known_hosts before writing to it. POSIX and ANSI C
authordtucker <dtucker@openbsd.org>
Tue, 21 Feb 2023 06:48:18 +0000 (06:48 +0000)
committerdtucker <dtucker@openbsd.org>
Tue, 21 Feb 2023 06:48:18 +0000 (06:48 +0000)
commit2598ede86241193a9b42d3672a4b3f6098170c3f
tree797fc7867e6b09e0f4ddc2b0b29f771c7167813d
parent58e22783d3c4def77aab6f8d8ddfcb22b561adae
fseek to end of known_hosts before writing to it.  POSIX and ANSI C
require that applications call fseek or similar between read and writing
to a RW file.  OpenBSD doesn't enforce this, but some (System V derived)
platforms need this to prevent it from writing a spurious extra byte (in
this case, a newline).  ok djm@ deraadt@
usr.bin/ssh/hostfile.c