diff options
author | des <des@FreeBSD.org> | 2013-04-02 11:44:55 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2013-04-02 11:44:55 +0000 |
commit | f1c9eb38e7f5d932f6f246353a1f646f551ffa55 (patch) | |
tree | c0624291b85cc0b3f2926f679e578a6b59ebcd50 /crypto/openssh/readconf.c | |
parent | 3325697f0c9f5298d7313d56bd4bb35e4fb47589 (diff) | |
download | FreeBSD-src-f1c9eb38e7f5d932f6f246353a1f646f551ffa55.zip FreeBSD-src-f1c9eb38e7f5d932f6f246353a1f646f551ffa55.tar.gz |
Merge upstream patch to silence spurious "no such identity file" warnings.
Diffstat (limited to 'crypto/openssh/readconf.c')
-rw-r--r-- | crypto/openssh/readconf.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/crypto/openssh/readconf.c b/crypto/openssh/readconf.c index 122d76a..e96200a 100644 --- a/crypto/openssh/readconf.c +++ b/crypto/openssh/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.194 2011/09/23 07:45:05 markus Exp $ */ +/* $OpenBSD: readconf.c,v 1.195 2013/02/17 23:16:57 dtucker Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -356,6 +356,26 @@ clear_forwardings(Options *options) options->tun_open = SSH_TUNMODE_NO; } +void +add_identity_file(Options *options, const char *dir, const char *filename, + int userprovided) +{ + char *path; + + if (options->num_identity_files >= SSH_MAX_IDENTITY_FILES) + fatal("Too many identity files specified (max %d)", + SSH_MAX_IDENTITY_FILES); + + if (dir == NULL) /* no dir, filename is absolute */ + path = xstrdup(filename); + else + (void)xasprintf(&path, "%.100s%.100s", dir, filename); + + options->identity_file_userprovided[options->num_identity_files] = + userprovided; + options->identity_files[options->num_identity_files++] = path; +} + /* * Returns the number of the token pointed to by cp or oBadOption. */ @@ -616,9 +636,7 @@ parse_yesnoask: if (*intptr >= SSH_MAX_IDENTITY_FILES) fatal("%.200s line %d: Too many identity files specified (max %d).", filename, linenum, SSH_MAX_IDENTITY_FILES); - charptr = &options->identity_files[*intptr]; - *charptr = xstrdup(arg); - *intptr = *intptr + 1; + add_identity_file(options, NULL, arg, 1); } break; |