From 7955633a554397bc24913cec9fd7285002935f7e Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Sat, 25 Jan 2020 00:21:08 +0000 Subject: upstream: allow UpdateKnownHosts=yes to function when multiple known_hosts files are in use. When updating host keys, ssh will now search subsequent known_hosts files, but will add new/changed host keys to the first specified file only. bz#2738 ok markus@ OpenBSD-Commit-ID: 6ded6d878a03e57d5aa20bab9c31f92e929dbc6c --- hostfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hostfile.c') diff --git a/hostfile.c b/hostfile.c index 96ab880d..4a0349a6 100644 --- a/hostfile.c +++ b/hostfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hostfile.c,v 1.76 2019/07/07 01:05:00 dtucker Exp $ */ +/* $OpenBSD: hostfile.c,v 1.77 2020/01/25 00:21:08 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -566,6 +566,7 @@ hostfile_replace_entries(const char *filename, const char *host, const char *ip, /* Remove all entries for the specified host from the file */ if ((r = hostkeys_foreach(filename, host_delete, &ctx, host, ip, HKF_WANT_PARSE_KEY)) != 0) { + oerrno = errno; error("%s: hostkeys_foreach failed: %s", __func__, ssh_err(r)); goto fail; } -- cgit v1.2.3