diff options
author | djm <djm> | 2011-05-29 11:42:08 +0000 |
---|---|---|
committer | djm <djm> | 2011-05-29 11:42:08 +0000 |
commit | 087eb1679773f4637917209324ae0fb3a8878a40 (patch) | |
tree | a7c16ae91018a877c81c3a87892b5bde5e6ce226 /authfile.c | |
parent | 2963c7ab86854dd6e4f31022a4624c2c23e63f20 (diff) | |
download | openssh-087eb1679773f4637917209324ae0fb3a8878a40.tar.gz |
- 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@
Diffstat (limited to 'authfile.c')
-rw-r--r-- | authfile.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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; } |