diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-11-05 20:38:03 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-11-05 20:38:03 +1100 |
commit | ce327b62ac28cb6a605fd827a97d978ea31e2860 (patch) | |
tree | 4238303b22083a2e00cef74ab894efb852e23685 /clientloop.c | |
parent | 5d78de628376f55fd2fc5acad14733cf90867425 (diff) |
- djm@cvs.openbsd.org 2004/10/29 22:53:56
[clientloop.c misc.h readpass.c ssh-agent.c]
factor out common permission-asking code to separate function; ok markus@
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/clientloop.c b/clientloop.c index 009480ea..d77337b8 100644 --- a/clientloop.c +++ b/clientloop.c @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.132 2004/10/29 21:47:15 djm Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.133 2004/10/29 22:53:56 djm Exp $"); #include "ssh.h" #include "ssh1.h" @@ -592,24 +592,9 @@ client_process_control(fd_set * readset) } allowed = 1; - if (options.control_master == 2) { - char *p, prompt[1024]; - - allowed = 0; - snprintf(prompt, sizeof(prompt), - "Allow shared connection to %s? ", host); - p = read_passphrase(prompt, RP_USE_ASKPASS|RP_ALLOW_EOF); - if (p != NULL) { - /* - * Accept empty responses and responses consisting - * of the word "yes" as affirmative. - */ - if (*p == '\0' || *p == '\n' || - strcasecmp(p, "yes") == 0) - allowed = 1; - xfree(p); - } - } + if (options.control_master == 2) + allowed = ask_permission("Allow shared connection to %s? ", + host); unset_nonblock(client_fd); |