mirror of
git://anongit.mindrot.org/openssh.git
synced 2025-01-03 08:12:05 +00:00
- markus@cvs.openbsd.org 2002/03/21 23:07:37
[clientloop.c] remove unused, sync w/ cmdline patch in my tree.
This commit is contained in:
parent
ba72d30aa5
commit
681d932634
@ -142,6 +142,9 @@
|
|||||||
- rees@cvs.openbsd.org 2002/03/21 22:44:05
|
- rees@cvs.openbsd.org 2002/03/21 22:44:05
|
||||||
[authfd.c authfd.h ssh-add.c ssh-agent.c ssh.c]
|
[authfd.c authfd.h ssh-add.c ssh-agent.c ssh.c]
|
||||||
Add PIN-protection for secret key.
|
Add PIN-protection for secret key.
|
||||||
|
- markus@cvs.openbsd.org 2002/03/21 23:07:37
|
||||||
|
[clientloop.c]
|
||||||
|
remove unused, sync w/ cmdline patch in my tree.
|
||||||
|
|
||||||
20020317
|
20020317
|
||||||
- (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is wanted,
|
- (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is wanted,
|
||||||
@ -7988,4 +7991,4 @@
|
|||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1965 2002/03/22 03:51:06 mouring Exp $
|
$Id: ChangeLog,v 1.1966 2002/03/22 03:53:00 mouring Exp $
|
||||||
|
31
clientloop.c
31
clientloop.c
@ -59,7 +59,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: clientloop.c,v 1.98 2002/03/21 16:58:13 markus Exp $");
|
RCSID("$OpenBSD: clientloop.c,v 1.99 2002/03/21 23:07:37 markus Exp $");
|
||||||
|
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
#include "ssh1.h"
|
#include "ssh1.h"
|
||||||
@ -472,39 +472,33 @@ client_process_net_input(fd_set * readset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
process_cmdline(Buffer *bin, Buffer *bout, Buffer *berr)
|
process_cmdline(void)
|
||||||
{
|
{
|
||||||
void (*handler)(int);
|
void (*handler)(int);
|
||||||
char *s, *cmd;
|
char *s, *cmd;
|
||||||
u_short fwd_port, fwd_host_port;
|
u_short fwd_port, fwd_host_port;
|
||||||
char buf[1024], sfwd_port[6], sfwd_host_port[6];
|
char buf[1024], sfwd_port[6], sfwd_host_port[6];
|
||||||
int local = 0;
|
int local = 0;
|
||||||
int n;
|
|
||||||
|
|
||||||
leave_raw_mode();
|
leave_raw_mode();
|
||||||
handler = signal(SIGINT, SIG_IGN);
|
handler = signal(SIGINT, SIG_IGN);
|
||||||
s = read_passphrase("\r\nssh> ", RP_ECHO);
|
cmd = s = read_passphrase("\r\nssh> ", RP_ECHO);
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
cmd = s;
|
|
||||||
|
|
||||||
while (*s && isspace(*s))
|
while (*s && isspace(*s))
|
||||||
s++;
|
s++;
|
||||||
|
|
||||||
if (*s == 0)
|
if (*s == 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (strlen(s) < 2 || s[0] != '-' || !(s[1] == 'L' || s[1] == 'R')) {
|
if (strlen(s) < 2 || s[0] != '-' || !(s[1] == 'L' || s[1] == 'R')) {
|
||||||
log("Invalid command");
|
log("Invalid command.");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (s[1] == 'L')
|
if (s[1] == 'L')
|
||||||
local = 1;
|
local = 1;
|
||||||
if (!local && !compat20) {
|
if (!local && !compat20) {
|
||||||
log("Not supported for SSH protocol version 1");
|
log("Not supported for SSH protocol version 1.");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
s += 2;
|
s += 2;
|
||||||
while (*s && isspace(*s))
|
while (*s && isspace(*s))
|
||||||
s++;
|
s++;
|
||||||
@ -513,25 +507,24 @@ process_cmdline(Buffer *bin, Buffer *bout, Buffer *berr)
|
|||||||
sfwd_port, buf, sfwd_host_port) != 3 &&
|
sfwd_port, buf, sfwd_host_port) != 3 &&
|
||||||
sscanf(s, "%5[0-9]/%255[^/]/%5[0-9]",
|
sscanf(s, "%5[0-9]/%255[^/]/%5[0-9]",
|
||||||
sfwd_port, buf, sfwd_host_port) != 3) {
|
sfwd_port, buf, sfwd_host_port) != 3) {
|
||||||
log("Bad forwarding specification");
|
log("Bad forwarding specification.");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if ((fwd_port = a2port(sfwd_port)) == 0 ||
|
if ((fwd_port = a2port(sfwd_port)) == 0 ||
|
||||||
(fwd_host_port = a2port(sfwd_host_port)) == 0) {
|
(fwd_host_port = a2port(sfwd_host_port)) == 0) {
|
||||||
log("Bad forwarding port(s)");
|
log("Bad forwarding port(s).");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (local) {
|
if (local) {
|
||||||
n = channel_setup_local_fwd_listener(fwd_port, buf,
|
if (channel_setup_local_fwd_listener(fwd_port, buf,
|
||||||
fwd_host_port, options.gateway_ports);
|
fwd_host_port, options.gateway_ports) < 0) {
|
||||||
if (n <= 0) {
|
log("Port forwarding failed.");
|
||||||
log("Port forwarding failed");
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
channel_request_remote_forwarding(fwd_port, buf,
|
channel_request_remote_forwarding(fwd_port, buf,
|
||||||
fwd_host_port);
|
fwd_host_port);
|
||||||
log("Forwarding port");
|
log("Forwarding port.");
|
||||||
out:
|
out:
|
||||||
signal(SIGINT, handler);
|
signal(SIGINT, handler);
|
||||||
enter_raw_mode();
|
enter_raw_mode();
|
||||||
@ -664,7 +657,7 @@ Supported escape sequences:\r\n\
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 'C':
|
case 'C':
|
||||||
process_cmdline(bin, bout, berr);
|
process_cmdline();
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user