diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2011-05-23 03:30:08 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2011-05-23 03:30:08 +0000 |
commit | 85ac1baaa89d5c17e5d9c22d76753223d8c5eee8 (patch) | |
tree | e17fbeeb53cf93b670e707ae7159fc843ee5b44b /usr.bin/ssh/auth2-pubkey.c | |
parent | adf15b3a2edc0fe7b3a09211ebfafe0131e32525 (diff) |
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 'usr.bin/ssh/auth2-pubkey.c')
-rw-r--r-- | usr.bin/ssh/auth2-pubkey.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/ssh/auth2-pubkey.c b/usr.bin/ssh/auth2-pubkey.c index 20ad508a905..57cc295156b 100644 --- a/usr.bin/ssh/auth2-pubkey.c +++ b/usr.bin/ssh/auth2-pubkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-pubkey.c,v 1.28 2011/05/11 04:47:06 djm Exp $ */ +/* $OpenBSD: auth2-pubkey.c,v 1.29 2011/05/23 03:30:07 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -435,7 +435,7 @@ user_cert_trusted_ca(struct passwd *pw, Key *key) int user_key_allowed(struct passwd *pw, Key *key) { - int success; + u_int success, i; char *file; if (auth_key_is_revoked(key)) @@ -447,9 +447,12 @@ user_key_allowed(struct passwd *pw, Key *key) if (success) return success; - file = authorized_keys_file(pw); - success = user_key_allowed2(pw, key, file); - xfree(file); + for (i = 0; !success && i < options.num_authkeys_files; i++) { + file = expand_authorized_keys( + options.authorized_keys_files[i], pw); + success = user_key_allowed2(pw, key, file); + xfree(file); + } return success; } |