Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 60720 Details for
Bug 95220
Need method for using the SSH_ASKPASS from terminal
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Forces ssh to use the SSH_ASKPASS method
force_askpass.patch (text/plain), 5.03 KB, created by
Brenden Conte
on 2005-06-06 07:25:18 UTC
(
hide
)
Description:
Forces ssh to use the SSH_ASKPASS method
Filename:
MIME Type:
Creator:
Brenden Conte
Created:
2005-06-06 07:25:18 UTC
Size:
5.03 KB
patch
obsolete
>diff -Naur openssh-3.9p1/readpass.c openssh-3.9p1.new/readpass.c >--- openssh-3.9p1/readpass.c 2004-06-17 11:19:03.000000000 -0400 >+++ openssh-3.9p1.new/readpass.c 2005-06-03 11:45:59.000000000 -0400 >@@ -116,7 +116,6 @@ > else > use_askpass = 1; > } >- > if ((flags & RP_USE_ASKPASS) && getenv("DISPLAY") == NULL) > return (flags & RP_ALLOW_EOF) ? NULL : xstrdup(""); > >diff -Naur openssh-3.9p1/ssh.1 openssh-3.9p1.new/ssh.1 >--- openssh-3.9p1/ssh.1 2004-08-13 07:22:40.000000000 -0400 >+++ openssh-3.9p1.new/ssh.1 2005-06-03 11:27:53.000000000 -0400 >@@ -774,6 +774,12 @@ > options force tty allocation, even if > .Nm > has no local tty. >+.It Fl u >+Force the use of the SSH_ASKPASS environment variable for all password >+prompts. DISPLAY does not need to be set. If SSH_ASKPASS is not set >+and >+.Fl u >+is used, it will try to use the default ASKPASS program. > .It Fl V > Display the version number and exit. > .It Fl v >diff -Naur openssh-3.9p1/ssh.c openssh-3.9p1.new/ssh.c >--- openssh-3.9p1/ssh.c 2004-08-15 03:23:34.000000000 -0400 >+++ openssh-3.9p1.new/ssh.c 2005-06-03 11:19:44.000000000 -0400 >@@ -79,6 +79,9 @@ > > extern char *__progname; > >+/* Flag indicating we wish to use the SSH_ASKPASS method regardless */ >+int force_use_askpass = 0; >+ > /* Flag indicating whether debug mode is on. This can be set on the command line. */ > int debug_flag = 0; > >@@ -154,7 +157,7 @@ > usage(void) > { > fprintf(stderr, >-"usage: ssh [-1246AaCfghkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]\n" >+"usage: ssh [-1246AaCfghkMNnqsTtuVvXxY] [-b bind_address] [-c cipher_spec]\n" > " [-D port] [-e escape_char] [-F configfile] [-i identity_file]\n" > " [-L port:host:hostport] [-l login_name] [-m mac_spec] [-o option]\n" > " [-p port] [-R port:host:hostport] [-S ctl] [user@]hostname [command]\n" >@@ -236,7 +239,7 @@ > > again: > while ((opt = getopt(ac, av, >- "1246ab:c:e:fgi:kl:m:no:p:qstvxACD:F:I:L:MNPR:S:TVXY")) != -1) { >+ "1246ab:c:e:fgi:kl:m:no:p:qstuvxACD:F:I:L:MNPR:S:TVXY")) != -1) { > switch (opt) { > case '1': > options.protocol = SSH_PROTO_1; >@@ -257,6 +260,10 @@ > fork_after_authentication_flag = 1; > stdin_null_flag = 1; > break; >+ case 'u': >+ force_use_askpass = 1; >+ setenv("DISPLAY","ASKPASS:FORCED",0); >+ break; > case 'x': > options.forward_x11 = 0; > break; >diff -Naur openssh-3.9p1/sshconnect2.c openssh-3.9p1.new/sshconnect2.c >--- openssh-3.9p1/sshconnect2.c 2004-06-14 20:30:09.000000000 -0400 >+++ openssh-3.9p1.new/sshconnect2.c 2005-06-03 11:46:35.000000000 -0400 >@@ -58,7 +58,7 @@ > extern char *client_version_string; > extern char *server_version_string; > extern Options options; >- >+extern int force_use_askpass; > /* > * SSH2 key exchange > */ >@@ -733,7 +733,7 @@ > > snprintf(prompt, sizeof(prompt), "%.30s@%.128s's password: ", > authctxt->server_user, authctxt->host); >- password = read_passphrase(prompt, 0); >+ password = read_passphrase(prompt, (force_use_askpass) ? RP_USE_ASKPASS : 0); > packet_start(SSH2_MSG_USERAUTH_REQUEST); > packet_put_cstring(authctxt->server_user); > packet_put_cstring(authctxt->service); >@@ -780,7 +780,7 @@ > snprintf(prompt, sizeof(prompt), > "Enter %.30s@%.128s's old password: ", > authctxt->server_user, authctxt->host); >- password = read_passphrase(prompt, 0); >+ password = read_passphrase(prompt, (force_use_askpass ? RP_USE_ASKPASS : 0)); > packet_put_cstring(password); > memset(password, 0, strlen(password)); > xfree(password); >@@ -789,7 +789,7 @@ > snprintf(prompt, sizeof(prompt), > "Enter %.30s@%.128s's new password: ", > authctxt->server_user, authctxt->host); >- password = read_passphrase(prompt, RP_ALLOW_EOF); >+ password = read_passphrase(prompt, RP_ALLOW_EOF | (force_use_askpass ? RP_USE_ASKPASS : 0)); > if (password == NULL) { > /* bail out */ > return; >@@ -797,7 +797,7 @@ > snprintf(prompt, sizeof(prompt), > "Retype %.30s@%.128s's new password: ", > authctxt->server_user, authctxt->host); >- retype = read_passphrase(prompt, 0); >+ retype = read_passphrase(prompt, (force_use_askpass ? RP_USE_ASKPASS : 0)); > if (strcmp(password, retype) != 0) { > memset(password, 0, strlen(password)); > xfree(password); >@@ -975,7 +975,7 @@ > snprintf(prompt, sizeof prompt, > "Enter passphrase for key '%.100s': ", filename); > for (i = 0; i < options.number_of_password_prompts; i++) { >- passphrase = read_passphrase(prompt, 0); >+ passphrase = read_passphrase(prompt, (force_use_askpass ? RP_USE_ASKPASS : 0)); > if (strcmp(passphrase, "") != 0) { > private = key_load_private_type(KEY_UNSPEC, filename, > passphrase, NULL); >@@ -1166,7 +1166,7 @@ > char *name, *inst, *lang, *prompt, *response; > u_int num_prompts, i; > int echo = 0; >- >+ int flags = 0; > debug2("input_userauth_info_req"); > > if (authctxt == NULL) >@@ -1200,7 +1200,7 @@ > prompt = packet_get_string(NULL); > echo = packet_get_char(); > >- response = read_passphrase(prompt, echo ? RP_ECHO : 0); >+ response = read_passphrase(prompt, (echo ? RP_ECHO : 0) | (force_use_askpass ? RP_USE_ASKPASS : 0)); > > packet_put_cstring(response); > memset(response, 0, strlen(response));
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 95220
:
60720
|
73192