version 1.1, 2009/06/07 22:19:07 |
version 1.2, 2009/06/07 22:38:46 |
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
*/ |
|
|
|
#include "includes.h" |
|
__RCSID("$NetBSD$"); |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/ioctl.h> |
#include <sys/ioctl.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
|
#include "misc.h" |
#include "misc.h" |
#include "match.h" |
#include "match.h" |
#include "msg.h" |
#include "msg.h" |
|
#include "getpeereid.h" |
|
|
/* import options */ |
/* import options */ |
extern Options options; |
extern Options options; |
Line 768 process_cmdline(void) |
|
Line 770 process_cmdline(void) |
|
cmd = 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; |
while (isspace(*s)) |
while (isspace((unsigned char)*s)) |
s++; |
s++; |
if (*s == '-') |
if (*s == '-') |
s++; /* Skip cmdline '-', if any */ |
s++; /* Skip cmdline '-', if any */ |
Line 822 process_cmdline(void) |
|
Line 824 process_cmdline(void) |
|
goto out; |
goto out; |
} |
} |
|
|
while (isspace(*++s)) |
s++; |
; |
while (isspace((unsigned char)*s)) |
|
s++; |
|
|
if (delete) { |
if (delete) { |
cancel_port = 0; |
cancel_port = 0; |
Line 1534 client_loop(int have_pty, int escape_cha |
|
Line 1537 client_loop(int have_pty, int escape_cha |
|
packet_get_state(MODE_IN, NULL, NULL, NULL, &ibytes); |
packet_get_state(MODE_IN, NULL, NULL, NULL, &ibytes); |
packet_get_state(MODE_OUT, NULL, NULL, NULL, &obytes); |
packet_get_state(MODE_OUT, NULL, NULL, NULL, &obytes); |
verbose("Transferred: sent %llu, received %llu bytes, in %.1f seconds", |
verbose("Transferred: sent %llu, received %llu bytes, in %.1f seconds", |
obytes, ibytes, total_time); |
(unsigned long long)obytes, (unsigned long long)ibytes, total_time); |
if (total_time > 0) |
if (total_time > 0) |
verbose("Bytes per second: sent %.1f, received %.1f", |
verbose("Bytes per second: sent %.1f, received %.1f", |
obytes / total_time, ibytes / total_time); |
obytes / total_time, ibytes / total_time); |
Line 1677 client_request_x11(const char *request_t |
|
Line 1680 client_request_x11(const char *request_t |
|
sock = x11_connect_display(); |
sock = x11_connect_display(); |
if (sock < 0) |
if (sock < 0) |
return NULL; |
return NULL; |
|
/* again is this really necessary for X11? */ |
|
if (options.hpn_disabled) |
c = channel_new("x11", |
c = channel_new("x11", |
SSH_CHANNEL_X11_OPEN, sock, sock, -1, |
SSH_CHANNEL_X11_OPEN, sock, sock, -1, |
CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0, "x11", 1); |
CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0, "x11", 1); |
|
else |
|
c = channel_new("x11", |
|
SSH_CHANNEL_X11_OPEN, sock, sock, -1, |
|
options.hpn_buffer_size, CHAN_X11_PACKET_DEFAULT, 0, "x11", 1); |
c->force_drain = 1; |
c->force_drain = 1; |
return c; |
return c; |
} |
} |
Line 1699 client_request_agent(const char *request |
|
Line 1708 client_request_agent(const char *request |
|
sock = ssh_get_authentication_socket(); |
sock = ssh_get_authentication_socket(); |
if (sock < 0) |
if (sock < 0) |
return NULL; |
return NULL; |
|
if (options.hpn_disabled) |
c = channel_new("authentication agent connection", |
c = channel_new("authentication agent connection", |
SSH_CHANNEL_OPEN, sock, sock, -1, |
SSH_CHANNEL_OPEN, sock, sock, -1, |
CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, |
CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, |
"authentication agent connection", 1); |
"authentication agent connection", 1); |
|
else |
|
c = channel_new("authentication agent connection", |
|
SSH_CHANNEL_OPEN, sock, sock, -1, |
|
options.hpn_buffer_size, options.hpn_buffer_size, 0, |
|
"authentication agent connection", 1); |
c->force_drain = 1; |
c->force_drain = 1; |
return c; |
return c; |
} |
} |
Line 1729 client_request_tun_fwd(int tun_mode, int |
|
Line 1744 client_request_tun_fwd(int tun_mode, int |
|
return -1; |
return -1; |
} |
} |
|
|
|
if(options.hpn_disabled) |
c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, |
c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, |
CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, "tun", 1); |
CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, "tun", 1); |
|
else |
|
c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, |
|
options.hpn_buffer_size, CHAN_TCP_PACKET_DEFAULT, 0, "tun", 1); |
c->datagram = 1; |
c->datagram = 1; |
|
|
packet_start(SSH2_MSG_CHANNEL_OPEN); |
packet_start(SSH2_MSG_CHANNEL_OPEN); |