diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-10-03 08:30:47 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-10-03 18:31:49 +1000 |
commit | 1286981d08b8429a64613215ce8bff3f6b32488a (patch) | |
tree | b11a8e7cf70c11b8f5b60bfde535af2283e863fa /readconf.c | |
parent | 332f21537293d66508f7342dc643bc7fe45f0f69 (diff) |
upstream: enable UpdateHostkeys by default when the configuration
has not overridden UserKnownHostsFile; ok markus@ "The timing is perfect"
deraadt@
OpenBSD-Commit-ID: 62df71c9c5242da5763cb473c2a2deefbd0cef60
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c index 554efd7c9..1963a83bc 100644 --- a/readconf.c +++ b/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.335 2020/08/27 02:11:09 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.336 2020/10/03 08:30:47 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -2178,8 +2178,14 @@ fill_default_options(Options * options) options->system_hostfiles[options->num_system_hostfiles++] = xstrdup(_PATH_SSH_SYSTEM_HOSTFILE2); } - if (options->update_hostkeys == -1) + if (options->update_hostkeys == -1) { + if (options->num_user_hostfiles == 0 || + (options->num_user_hostfiles == 1 && strcmp(options-> + user_hostfiles[0], _PATH_SSH_USER_HOSTFILE) == 0)) + options->update_hostkeys = SSH_UPDATE_HOSTKEYS_YES; + else options->update_hostkeys = SSH_UPDATE_HOSTKEYS_NO; + } if (options->num_user_hostfiles == 0) { options->user_hostfiles[options->num_user_hostfiles++] = xstrdup(_PATH_SSH_USER_HOSTFILE); |