diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | clientloop.c | 31 |
2 files changed, 16 insertions, 20 deletions
@@ -142,6 +142,9 @@ | |||
142 | - rees@cvs.openbsd.org 2002/03/21 22:44:05 | 142 | - rees@cvs.openbsd.org 2002/03/21 22:44:05 |
143 | [authfd.c authfd.h ssh-add.c ssh-agent.c ssh.c] | 143 | [authfd.c authfd.h ssh-add.c ssh-agent.c ssh.c] |
144 | Add PIN-protection for secret key. | 144 | Add PIN-protection for secret key. |
145 | - markus@cvs.openbsd.org 2002/03/21 23:07:37 | ||
146 | [clientloop.c] | ||
147 | remove unused, sync w/ cmdline patch in my tree. | ||
145 | 148 | ||
146 | 20020317 | 149 | 20020317 |
147 | - (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is wanted, | 150 | - (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is wanted, |
@@ -7988,4 +7991,4 @@ | |||
7988 | - Wrote replacements for strlcpy and mkdtemp | 7991 | - Wrote replacements for strlcpy and mkdtemp |
7989 | - Released 1.0pre1 | 7992 | - Released 1.0pre1 |
7990 | 7993 | ||
7991 | $Id: ChangeLog,v 1.1965 2002/03/22 03:51:06 mouring Exp $ | 7994 | $Id: ChangeLog,v 1.1966 2002/03/22 03:53:00 mouring Exp $ |
diff --git a/clientloop.c b/clientloop.c index dbac4091f..7644ff39c 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -59,7 +59,7 @@ | |||
59 | */ | 59 | */ |
60 | 60 | ||
61 | #include "includes.h" | 61 | #include "includes.h" |
62 | RCSID("$OpenBSD: clientloop.c,v 1.98 2002/03/21 16:58:13 markus Exp $"); | 62 | RCSID("$OpenBSD: clientloop.c,v 1.99 2002/03/21 23:07:37 markus Exp $"); |
63 | 63 | ||
64 | #include "ssh.h" | 64 | #include "ssh.h" |
65 | #include "ssh1.h" | 65 | #include "ssh1.h" |
@@ -472,39 +472,33 @@ client_process_net_input(fd_set * readset) | |||
472 | } | 472 | } |
473 | 473 | ||
474 | static void | 474 | static void |
475 | process_cmdline(Buffer *bin, Buffer *bout, Buffer *berr) | 475 | process_cmdline(void) |
476 | { | 476 | { |
477 | void (*handler)(int); | 477 | void (*handler)(int); |
478 | char *s, *cmd; | 478 | char *s, *cmd; |
479 | u_short fwd_port, fwd_host_port; | 479 | u_short fwd_port, fwd_host_port; |
480 | char buf[1024], sfwd_port[6], sfwd_host_port[6]; | 480 | char buf[1024], sfwd_port[6], sfwd_host_port[6]; |
481 | int local = 0; | 481 | int local = 0; |
482 | int n; | ||
483 | 482 | ||
484 | leave_raw_mode(); | 483 | leave_raw_mode(); |
485 | handler = signal(SIGINT, SIG_IGN); | 484 | handler = signal(SIGINT, SIG_IGN); |
486 | s = read_passphrase("\r\nssh> ", RP_ECHO); | 485 | cmd = s = read_passphrase("\r\nssh> ", RP_ECHO); |
487 | if (s == NULL) | 486 | if (s == NULL) |
488 | goto out; | 487 | goto out; |
489 | cmd = s; | ||
490 | |||
491 | while (*s && isspace(*s)) | 488 | while (*s && isspace(*s)) |
492 | s++; | 489 | s++; |
493 | |||
494 | if (*s == 0) | 490 | if (*s == 0) |
495 | goto out; | 491 | goto out; |
496 | |||
497 | if (strlen(s) < 2 || s[0] != '-' || !(s[1] == 'L' || s[1] == 'R')) { | 492 | if (strlen(s) < 2 || s[0] != '-' || !(s[1] == 'L' || s[1] == 'R')) { |
498 | log("Invalid command"); | 493 | log("Invalid command."); |
499 | goto out; | 494 | goto out; |
500 | } | 495 | } |
501 | if (s[1] == 'L') | 496 | if (s[1] == 'L') |
502 | local = 1; | 497 | local = 1; |
503 | if (!local && !compat20) { | 498 | if (!local && !compat20) { |
504 | log("Not supported for SSH protocol version 1"); | 499 | log("Not supported for SSH protocol version 1."); |
505 | goto out; | 500 | goto out; |
506 | } | 501 | } |
507 | |||
508 | s += 2; | 502 | s += 2; |
509 | while (*s && isspace(*s)) | 503 | while (*s && isspace(*s)) |
510 | s++; | 504 | s++; |
@@ -513,25 +507,24 @@ process_cmdline(Buffer *bin, Buffer *bout, Buffer *berr) | |||
513 | sfwd_port, buf, sfwd_host_port) != 3 && | 507 | sfwd_port, buf, sfwd_host_port) != 3 && |
514 | sscanf(s, "%5[0-9]/%255[^/]/%5[0-9]", | 508 | sscanf(s, "%5[0-9]/%255[^/]/%5[0-9]", |
515 | sfwd_port, buf, sfwd_host_port) != 3) { | 509 | sfwd_port, buf, sfwd_host_port) != 3) { |
516 | log("Bad forwarding specification"); | 510 | log("Bad forwarding specification."); |
517 | goto out; | 511 | goto out; |
518 | } | 512 | } |
519 | if ((fwd_port = a2port(sfwd_port)) == 0 || | 513 | if ((fwd_port = a2port(sfwd_port)) == 0 || |
520 | (fwd_host_port = a2port(sfwd_host_port)) == 0) { | 514 | (fwd_host_port = a2port(sfwd_host_port)) == 0) { |
521 | log("Bad forwarding port(s)"); | 515 | log("Bad forwarding port(s)."); |
522 | goto out; | 516 | goto out; |
523 | } | 517 | } |
524 | if (local) { | 518 | if (local) { |
525 | n = channel_setup_local_fwd_listener(fwd_port, buf, | 519 | if (channel_setup_local_fwd_listener(fwd_port, buf, |
526 | fwd_host_port, options.gateway_ports); | 520 | fwd_host_port, options.gateway_ports) < 0) { |
527 | if (n <= 0) { | 521 | log("Port forwarding failed."); |
528 | log("Port forwarding failed"); | ||
529 | goto out; | 522 | goto out; |
530 | } | 523 | } |
531 | } else | 524 | } else |
532 | channel_request_remote_forwarding(fwd_port, buf, | 525 | channel_request_remote_forwarding(fwd_port, buf, |
533 | fwd_host_port); | 526 | fwd_host_port); |
534 | log("Forwarding port"); | 527 | log("Forwarding port."); |
535 | out: | 528 | out: |
536 | signal(SIGINT, handler); | 529 | signal(SIGINT, handler); |
537 | enter_raw_mode(); | 530 | enter_raw_mode(); |
@@ -664,7 +657,7 @@ Supported escape sequences:\r\n\ | |||
664 | continue; | 657 | continue; |
665 | 658 | ||
666 | case 'C': | 659 | case 'C': |
667 | process_cmdline(bin, bout, berr); | 660 | process_cmdline(); |
668 | continue; | 661 | continue; |
669 | 662 | ||
670 | default: | 663 | default: |