Bugzilla – Attachment 2219 Details for
Bug 1981
Trying to use ssh with a missing identity file gives no warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
updated patch with feedback
ssh-identityfile.patch (text/plain), 2.83 KB, created by
Darren Tucker
on 2013-02-15 10:38:21 AEDT
(
hide
)
Description:
updated patch with feedback
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2013-02-15 10:38:21 AEDT
Size:
2.83 KB
patch
obsolete
>Index: sshconnect2.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sshconnect2.c,v >retrieving revision 1.190 >diff -u -p -r1.190 sshconnect2.c >--- sshconnect2.c 2 Dec 2012 20:26:11 -0000 1.190 >+++ sshconnect2.c 14 Feb 2013 23:36:09 -0000 >@@ -242,6 +242,7 @@ struct identity { > char *filename; /* comment for agent-only keys */ > int tried; > int isprivate; /* key points to the private key */ >+ int userprovided; > }; > TAILQ_HEAD(idlist, identity); > >@@ -306,7 +307,7 @@ void userauth(Authctxt *, char *); > static int sign_and_send_pubkey(Authctxt *, Identity *); > static void pubkey_prepare(Authctxt *); > static void pubkey_cleanup(Authctxt *); >-static Key *load_identity_file(char *); >+static Key *load_identity_file(char *, int); > > static Authmethod *authmethod_get(char *authlist); > static Authmethod *authmethod_lookup(const char *name); >@@ -1180,7 +1181,7 @@ identity_sign(Identity *id, u_char **sig > if (id->isprivate || (id->key->flags & KEY_FLAG_EXT)) > return (key_sign(id->key, sigp, lenp, data, datalen)); > /* load the private key from the file */ >- if ((prv = load_identity_file(id->filename)) == NULL) >+ if ((prv = load_identity_file(id->filename, id->userprovided)) == NULL) > return (-1); > ret = key_sign(prv, sigp, lenp, data, datalen); > key_free(prv); >@@ -1305,7 +1306,7 @@ send_pubkey_test(Authctxt *authctxt, Ide > } > > static Key * >-load_identity_file(char *filename) >+load_identity_file(char *filename, int userprovided) > { > Key *private; > char prompt[300], *passphrase; >@@ -1313,7 +1314,8 @@ load_identity_file(char *filename) > struct stat st; > > if (stat(filename, &st) < 0) { >- debug3("no such identity: %s", filename); >+ (userprovided ? logit : debug3)("no such identity: %s: %s", >+ filename, strerror(errno)); > return NULL; > } > private = key_load_private_type(KEY_UNSPEC, filename, "", NULL, &perm_ok); >@@ -1376,6 +1378,7 @@ pubkey_prepare(Authctxt *authctxt) > id = xcalloc(1, sizeof(*id)); > id->key = key; > id->filename = xstrdup(options.identity_files[i]); >+ id->userprovided = 1; > TAILQ_INSERT_TAIL(&files, id, next); > } > /* Prefer PKCS11 keys that are explicitly listed */ >@@ -1440,7 +1443,8 @@ pubkey_prepare(Authctxt *authctxt) > TAILQ_INSERT_TAIL(preferred, id, next); > } > TAILQ_FOREACH(id, preferred, next) { >- debug2("key: %s (%p)", id->filename, id->key); >+ debug2("key: %s (%p),%s", id->filename, id->key, >+ id->userprovided ? " explicit" : ""); > } > } > >@@ -1485,7 +1489,8 @@ userauth_pubkey(Authctxt *authctxt) > sent = send_pubkey_test(authctxt, id); > } else if (id->key == NULL) { > debug("Trying private key: %s", id->filename); >- id->key = load_identity_file(id->filename); >+ id->key = load_identity_file(id->filename, >+ id->userprovided); > if (id->key != NULL) { > id->isprivate = 1; > sent = sign_and_send_pubkey(authctxt, id);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
djm
:
ok+
Actions:
View
|
Diff
Attachments on
bug 1981
:
2136
| 2219