summaryrefslogtreecommitdiff
path: root/auth.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-12-20 23:36:51 +0000
committerDamien Miller <djm@mindrot.org>2020-12-21 10:52:28 +1100
commitb4c7cd1185c5dc0593d47eafcc1a34fda569dd1d (patch)
treeefcf7641caaa015124a7b5cfd6622a0791ed0c32 /auth.c
parent06fbb386bed666581095cb9cbc7a900e02bfe1b7 (diff)
downloadopenssh-git-b4c7cd1185c5dc0593d47eafcc1a34fda569dd1d.tar.gz
upstream: load_hostkeys()/hostkeys_foreach() variants for FILE*
Add load_hostkeys_file() and hostkeys_foreach_file() that accept a FILE* argument instead of opening the file directly. Original load_hostkeys() and hostkeys_foreach() are implemented using these new interfaces. Add a u_int note field to the hostkey_entry and hostkey_foreach_line structs that is passed directly from the load_hostkeys() and hostkeys_foreach() call. This is a lightweight way to annotate results between different invocations of load_hostkeys(). ok markus@ OpenBSD-Commit-ID: 6ff6db13ec9ee4edfa658b2c38baad0f505d8c20
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/auth.c b/auth.c
index e82d7fea..e1bf4e75 100644
--- a/auth.c
+++ b/auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.149 2020/10/18 11:32:01 djm Exp $ */
+/* $OpenBSD: auth.c,v 1.150 2020/12/20 23:36:51 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -468,7 +468,7 @@ check_key_in_hostfiles(struct passwd *pw, struct sshkey *key, const char *host,
const struct hostkey_entry *found;
hostkeys = init_hostkeys();
- load_hostkeys(hostkeys, host, sysfile);
+ load_hostkeys(hostkeys, host, sysfile, 0);
if (userfile != NULL) {
user_hostfile = tilde_expand_filename(userfile, pw->pw_uid);
if (options.strict_modes &&
@@ -482,7 +482,7 @@ check_key_in_hostfiles(struct passwd *pw, struct sshkey *key, const char *host,
user_hostfile);
} else {
temporarily_use_uid(pw);
- load_hostkeys(hostkeys, host, user_hostfile);
+ load_hostkeys(hostkeys, host, user_hostfile, 0);
restore_uid();
}
free(user_hostfile);