[openssh-commits] [openssh] 02/08: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Oct 29 19:07:29 AEDT 2015


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 03239c18312b9bab7d1c3b03062c61e8bbc1ca6e
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Sun Oct 25 23:42:00 2015 +0000

    upstream commit
    
    Expand tildes in filenames passed to -i before checking
     whether or not the identity file exists.  This means that if the shell
     doesn't do the expansion (eg because the option and filename were given as a
     single argument) then we'll still add the key.  bz#2481, ok markus@
    
    Upstream-ID: db1757178a14ac519e9a3e1a2dbd21113cb3bfc6
---
 ssh.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/ssh.c b/ssh.c
index de4e615..cceb36e 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.428 2015/10/16 18:40:49 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.429 2015/10/25 23:42:00 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -714,13 +714,14 @@ main(int ac, char **av)
 			options.gss_deleg_creds = 1;
 			break;
 		case 'i':
-			if (stat(optarg, &st) < 0) {
+			p = tilde_expand_filename(optarg, original_real_uid);
+			if (stat(p, &st) < 0)
 				fprintf(stderr, "Warning: Identity file %s "
-				    "not accessible: %s.\n", optarg,
+				    "not accessible: %s.\n", p,
 				    strerror(errno));
-				break;
-			}
-			add_identity_file(&options, NULL, optarg, 1);
+			else
+				add_identity_file(&options, NULL, p, 1);
+			free(p);
 			break;
 		case 'I':
 #ifdef ENABLE_PKCS11

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list