summaryrefslogtreecommitdiff
path: root/auth2-pubkey.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2011-05-29 21:39:36 +1000
committerDamien Miller <djm@mindrot.org>2011-05-29 21:39:36 +1000
commitd8478b6a9b32760d47c2419279c4a73f5f88fdb6 (patch)
treeb62b256606749fbb784ab7c2c7baa610c2a7dd71 /auth2-pubkey.c
parentacacced70b3fd520ee3f12d3f477f9fd7c2f687a (diff)
OpenBSD CVS Sync
- djm@cvs.openbsd.org 2011/05/23 03:30:07 [auth-rsa.c auth.c auth.h auth2-pubkey.c monitor.c monitor_wrap.c pathnames.h servconf.c servconf.h sshd.8 sshd_config sshd_config.5] allow AuthorizedKeysFile to specify multiple files, separated by spaces. Bring back authorized_keys2 as a default search path (to avoid breaking existing users of this file), but override this in sshd_config so it will be no longer used on fresh installs. Maybe in 2015 we can remove it entierly :) feedback and ok markus@ dtucker@
Diffstat (limited to 'auth2-pubkey.c')
-rw-r--r--auth2-pubkey.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/auth2-pubkey.c b/auth2-pubkey.c
index a97509c28..137887ecd 100644
--- a/auth2-pubkey.c
+++ b/auth2-pubkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-pubkey.c,v 1.28 2011/05/11 04:47:06 djm Exp $ */ 1/* $OpenBSD: auth2-pubkey.c,v 1.29 2011/05/23 03:30:07 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -436,7 +436,7 @@ user_cert_trusted_ca(struct passwd *pw, Key *key)
436int 436int
437user_key_allowed(struct passwd *pw, Key *key) 437user_key_allowed(struct passwd *pw, Key *key)
438{ 438{
439 int success; 439 u_int success, i;
440 char *file; 440 char *file;
441 441
442 if (auth_key_is_revoked(key)) 442 if (auth_key_is_revoked(key))
@@ -448,9 +448,12 @@ user_key_allowed(struct passwd *pw, Key *key)
448 if (success) 448 if (success)
449 return success; 449 return success;
450 450
451 file = authorized_keys_file(pw); 451 for (i = 0; !success && i < options.num_authkeys_files; i++) {
452 success = user_key_allowed2(pw, key, file); 452 file = expand_authorized_keys(
453 xfree(file); 453 options.authorized_keys_files[i], pw);
454 success = user_key_allowed2(pw, key, file);
455 xfree(file);
456 }
454 457
455 return success; 458 return success;
456} 459}