diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2004-10-29 22:53:57 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2004-10-29 22:53:57 +0000 |
commit | 45681a89596cc85d74d0a6297295eb2653f0367d (patch) | |
tree | 03cc86f7b2df7564a83f24dd8ed079f4bc65d891 /usr.bin/ssh/clientloop.c | |
parent | a442ed804762d8b605eb1ddfed148a91c4ace07e (diff) |
factor out common permission-asking code to separate function; ok markus@
Diffstat (limited to 'usr.bin/ssh/clientloop.c')
-rw-r--r-- | usr.bin/ssh/clientloop.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index 009480ea187..d77337b826b 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/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); |