Bugzilla – Attachment 2004 Details for
Bug 1871
ssh-askpass should be able to distinguish between a prompt for confirmation and a prompt for an actual passphrase
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
set SSH_ASKPASS_CONFIRMATION_ONLY when just asking for permission
set-SSH_ASKPASS_CONFIRMATION_ONLY-when-appropriate.diff (text/plain), 2.02 KB, created by
Daniel Kahn Gillmor
on 2011-02-25 10:00:35 AEDT
(
hide
)
Description:
set SSH_ASKPASS_CONFIRMATION_ONLY when just asking for permission
Filename:
MIME Type:
Creator:
Daniel Kahn Gillmor
Created:
2011-02-25 10:00:35 AEDT
Size:
2.02 KB
patch
obsolete
>=== modified file 'misc.h' >--- misc.h 2011-01-24 12:43:25 +0000 >+++ misc.h 2011-02-24 22:31:13 +0000 >@@ -97,6 +97,7 @@ > #define RP_ALLOW_STDIN 0x0002 > #define RP_ALLOW_EOF 0x0004 > #define RP_USE_ASKPASS 0x0008 >+#define RP_CONFIRMATION_ONLY 0x0010 > > char *read_passphrase(const char *, int); > int ask_permission(const char *, ...) __attribute__((format(printf, 1, 2))); > >=== modified file 'readpass.c' >--- readpass.c 2011-01-06 11:43:44 +0000 >+++ readpass.c 2011-02-24 22:47:40 +0000 >@@ -48,7 +48,7 @@ > #include "uidswap.h" > > static char * >-ssh_askpass(char *askpass, const char *msg) >+ssh_askpass(char *askpass, const char *msg, int confirmation_only) > { > pid_t pid, ret; > size_t len; >@@ -76,6 +76,7 @@ > close(p[0]); > if (dup2(p[1], STDOUT_FILENO) < 0) > fatal("ssh_askpass: dup2: %s", strerror(errno)); >+ putenv(confirmation_only ? "SSH_ASKPASS_CONFIRMATION_ONLY=" : "SSH_ASKPASS_CONFIRMATION_ONLY"); > execlp(askpass, askpass, msg, (char *) 0); > fatal("ssh_askpass: exec(%s): %s", askpass, strerror(errno)); > } >@@ -119,9 +120,10 @@ > read_passphrase(const char *prompt, int flags) > { > char *askpass = NULL, *ret, buf[1024]; >- int rppflags, use_askpass = 0, ttyfd; >+ int rppflags, use_askpass = 0, ttyfd, confirmation_only; > > rppflags = (flags & RP_ECHO) ? RPP_ECHO_ON : RPP_ECHO_OFF; >+ confirmation_only = (flags & RP_CONFIRMATION_ONLY); > if (flags & RP_USE_ASKPASS) > use_askpass = 1; > else if (flags & RP_ALLOW_STDIN) { >@@ -149,7 +151,7 @@ > askpass = getenv(SSH_ASKPASS_ENV); > else > askpass = _PATH_SSH_ASKPASS_DEFAULT; >- if ((ret = ssh_askpass(askpass, prompt)) == NULL) >+ if ((ret = ssh_askpass(askpass, prompt, confirmation_only)) == NULL) > if (!(flags & RP_ALLOW_EOF)) > return xstrdup(""); > return ret; >@@ -177,7 +179,7 @@ > vsnprintf(prompt, sizeof(prompt), fmt, args); > va_end(args); > >- p = read_passphrase(prompt, RP_USE_ASKPASS|RP_ALLOW_EOF); >+ p = read_passphrase(prompt, RP_USE_ASKPASS|RP_ALLOW_EOF|RP_CONFIRMATION_ONLY); > if (p != NULL) { > /* > * Accept empty responses and responses consisting >
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
Actions:
View
|
Diff
Attachments on
bug 1871
:
2003
| 2004