svn commit: r249005 - vendor-crypto/openssh/dist
Dag-Erling Smørgrav
des at FreeBSD.org
Tue Apr 2 08:41:40 UTC 2013
Author: des
Date: Tue Apr 2 08:41:38 2013
New Revision: 249005
URL: http://svnweb.freebsd.org/changeset/base/249005
Log:
Pull in a patchset from upstream to silence spurious "no such identity
file" warnings.
Modified:
vendor-crypto/openssh/dist/readconf.c
vendor-crypto/openssh/dist/readconf.h
vendor-crypto/openssh/dist/ssh.c
vendor-crypto/openssh/dist/sshconnect2.c
Modified: vendor-crypto/openssh/dist/readconf.c
==============================================================================
--- vendor-crypto/openssh/dist/readconf.c Tue Apr 2 08:15:39 2013 (r249004)
+++ vendor-crypto/openssh/dist/readconf.c Tue Apr 2 08:41:38 2013 (r249005)
@@ -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 $ */
/*
* Author: Tatu Ylonen <ylo at cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -326,6 +326,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.
*/
@@ -586,9 +606,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;
Modified: vendor-crypto/openssh/dist/readconf.h
==============================================================================
--- vendor-crypto/openssh/dist/readconf.h Tue Apr 2 08:15:39 2013 (r249004)
+++ vendor-crypto/openssh/dist/readconf.h Tue Apr 2 08:41:38 2013 (r249005)
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.h,v 1.91 2011/09/23 07:45:05 markus Exp $ */
+/* $OpenBSD: readconf.h,v 1.92 2013/02/17 23:16:57 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo at cs.hut.fi>
@@ -96,6 +96,7 @@ typedef struct {
int num_identity_files; /* Number of files for RSA/DSA identities. */
char *identity_files[SSH_MAX_IDENTITY_FILES];
+ int identity_file_userprovided[SSH_MAX_IDENTITY_FILES];
Key *identity_keys[SSH_MAX_IDENTITY_FILES];
/* Local TCP/IP forward requests. */
@@ -158,5 +159,6 @@ process_config_line(Options *, const cha
void add_local_forward(Options *, const Forward *);
void add_remote_forward(Options *, const Forward *);
+void add_identity_file(Options *, const char *, const char *, int);
#endif /* READCONF_H */
Modified: vendor-crypto/openssh/dist/ssh.c
==============================================================================
--- vendor-crypto/openssh/dist/ssh.c Tue Apr 2 08:15:39 2013 (r249004)
+++ vendor-crypto/openssh/dist/ssh.c Tue Apr 2 08:41:38 2013 (r249005)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.370 2012/07/06 01:47:38 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.371 2013/02/17 23:16:57 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo at cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -405,12 +405,7 @@ main(int ac, char **av)
strerror(errno));
break;
}
- if (options.num_identity_files >=
- SSH_MAX_IDENTITY_FILES)
- fatal("Too many identity files specified "
- "(max %d)", SSH_MAX_IDENTITY_FILES);
- options.identity_files[options.num_identity_files++] =
- xstrdup(optarg);
+ add_identity_file(&options, NULL, optarg, 1);
break;
case 'I':
#ifdef ENABLE_PKCS11
Modified: vendor-crypto/openssh/dist/sshconnect2.c
==============================================================================
--- vendor-crypto/openssh/dist/sshconnect2.c Tue Apr 2 08:15:39 2013 (r249004)
+++ vendor-crypto/openssh/dist/sshconnect2.c Tue Apr 2 08:41:38 2013 (r249005)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.191 2013/02/15 00:21:01 dtucker Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.192 2013/02/17 23:16:57 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -1384,7 +1384,7 @@ pubkey_prepare(Authctxt *authctxt)
id = xcalloc(1, sizeof(*id));
id->key = key;
id->filename = xstrdup(options.identity_files[i]);
- id->userprovided = 1;
+ id->userprovided = options.identity_file_userprovided[i];
TAILQ_INSERT_TAIL(&files, id, next);
}
/* Prefer PKCS11 keys that are explicitly listed */
More information about the svn-src-all
mailing list