]> git.ipfire.org Git - thirdparty/openssh-portable.git/commit
upstream: fseek to end of known_hosts before writing to it.
authordtucker@openbsd.org <dtucker@openbsd.org>
Tue, 21 Feb 2023 06:48:18 +0000 (06:48 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Tue, 21 Feb 2023 07:28:26 +0000 (18:28 +1100)
commitfe0bd3cde9665d364e5eedd2c2c2e60d4cdc3786
tree23bd870da82beed9fc96f31d499e9659d14e567a
parent357fb8ae14c07cd025eeed66e73de91bab569849
upstream: 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@

OpenBSD-Commit-ID: 33e680dcd8110582a93a40a8491024e961f45137
hostfile.c