Bugzilla – Attachment 2946 Details for
Bug 2682
ssh-agent is unable to remove smartcard after introducing whitelist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
file_2682.txt (text/plain), 1.38 KB, created by
Jakub Jelen
on 2017-02-22 03:16:03 AEDT
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Jakub Jelen
Created:
2017-02-22 03:16:03 AEDT
Size:
1.38 KB
patch
obsolete
>diff --git a/ssh-agent.c b/ssh-agent.c >index 1320cda..c05adba 100644 >--- a/ssh-agent.c >+++ b/ssh-agent.c >@@ -821,7 +821,7 @@ send: > static void > process_remove_smartcard_key(SocketEntry *e) > { >- char *provider = NULL, *pin = NULL; >+ char *provider = NULL, *pin = NULL, canonical_provider[PATH_MAX]; > int r, version, success = 0; > Identity *id, *nxt; > Idtab *tab; >@@ -831,6 +831,13 @@ process_remove_smartcard_key(SocketEntry *e) > fatal("%s: buffer error: %s", __func__, ssh_err(r)); > free(pin); > >+ if (realpath(provider, canonical_provider) == NULL) { >+ verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", >+ provider, strerror(errno)); >+ goto send; >+ } >+ >+ debug("%s: remove %.100s", __func__, canonical_provider); > for (version = 1; version < 3; version++) { > tab = idtab_lookup(version); > for (id = TAILQ_FIRST(&tab->idlist); id; id = nxt) { >@@ -838,14 +845,14 @@ process_remove_smartcard_key(SocketEntry *e) > /* Skip file--based keys */ > if (id->provider == NULL) > continue; >- if (!strcmp(provider, id->provider)) { >+ if (!strcmp(canonical_provider, id->provider)) { > TAILQ_REMOVE(&tab->idlist, id, next); > free_identity(id); > tab->nentries--; > } > } > } >- if (pkcs11_del_provider(provider) == 0) >+ if (pkcs11_del_provider(canonical_provider) == 0) > success = 1; > else > error("process_remove_smartcard_key:"
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:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2682
: 2946