summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2011-05-29 21:42:08 +1000
committerDamien Miller <djm@mindrot.org>2011-05-29 21:42:08 +1000
commit04bb56ef10bca3219010fdb191f1f9941353174b (patch)
tree9905ff9f5bed39dea1cd2aa0f989155df6fb1c07
parentb9132fc42717152cdb222a01595a4e6c04e257b3 (diff)
- djm@cvs.openbsd.org 2011/05/23 07:24:57
[authfile.c] read in key comments for v.2 keys (though note that these are not passed over the agent protocol); bz#439, based on patch from binder AT arago.de; ok markus@
-rw-r--r--ChangeLog5
-rw-r--r--authfile.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index acf4ea27..f3f43a13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,11 @@
- jmc@cvs.openbsd.org 2011/05/23 07:10:21
[sshd.8 sshd_config.5]
tweak previous; ok djm
+ - djm@cvs.openbsd.org 2011/05/23 07:24:57
+ [authfile.c]
+ read in key comments for v.2 keys (though note that these are not
+ passed over the agent protocol); bz#439, based on patch from binder
+ AT arago.de; ok markus@
20110520
- (djm) [session.c] call setexeccon() before executing passwd for pw
diff --git a/authfile.c b/authfile.c
index 734d657e..96d2bf33 100644
--- a/authfile.c
+++ b/authfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authfile.c,v 1.90 2011/05/13 00:05:36 djm Exp $ */
+/* $OpenBSD: authfile.c,v 1.91 2011/05/23 07:24:57 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -774,8 +774,11 @@ key_try_load_public(Key *k, const char *filename, char **commentp)
;
if (*cp) {
if (key_read(k, &cp) == 1) {
- if (commentp)
- *commentp=xstrdup(filename);
+ cp[strcspn(cp, "\r\n")] = '\0';
+ if (commentp) {
+ *commentp = xstrdup(*cp ?
+ cp : filename);
+ }
fclose(f);
return 1;
}