summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2003-08-29 10:04:37 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2003-08-29 10:04:37 +0000
commit4409f4d7f2e63405a8e38c8689c6051ae3779bf2 (patch)
tree407733b5afdb26e61ae3f861dbedfca6dd8327ad /usr.bin/ssh
parent792276f370f3e44b15e217cd53e6a6e5d42b3e46 (diff)
be less chatty; debug -> debug2, cleanup; ok henning@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/channels.c62
-rw-r--r--usr.bin/ssh/nchan.c46
2 files changed, 54 insertions, 54 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index 48d3752f502..272d67c846a 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -39,7 +39,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.193 2003/07/02 14:51:16 markus Exp $");
+RCSID("$OpenBSD: channels.c,v 1.194 2003/08/29 10:04:36 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -177,7 +177,7 @@ channel_register_fds(Channel *c, int rfd, int wfd, int efd,
/* XXX ugly hack: nonblock is only set by the server */
if (nonblock && isatty(c->rfd)) {
- debug("channel %d: rfd %d isatty", c->self, c->rfd);
+ debug2("channel %d: rfd %d isatty", c->self, c->rfd);
c->isatty = 1;
if (!isatty(c->wfd)) {
error("channel %d: wfd %d is not a tty?",
@@ -303,7 +303,7 @@ channel_close_fd(int *fdp)
static void
channel_close_fds(Channel *c)
{
- debug3("channel_close_fds: channel %d: r %d w %d e %d",
+ debug3("channel %d: close_fds r %d w %d e %d",
c->self, c->rfd, c->wfd, c->efd);
channel_close_fd(&c->sock);
@@ -323,11 +323,11 @@ channel_free(Channel *c)
for (n = 0, i = 0; i < channels_alloc; i++)
if (channels[i])
n++;
- debug("channel_free: channel %d: %s, nchannels %d", c->self,
+ debug("channel %d: free: %s, nchannels %d", c->self,
c->remote_name ? c->remote_name : "???", n);
s = channel_open_message();
- debug3("channel_free: status: %s", s);
+ debug3("channel %d: status: %s", c->self, s);
xfree(s);
if (c->sock != -1)
@@ -595,7 +595,7 @@ channel_request_start(int id, char *service, int wantconfirm)
logit("channel_request_start: %d: unknown channel id", id);
return;
}
- debug("channel %d: request %s", id, service) ;
+ debug2("channel %d: request %s", id, service) ;
packet_start(SSH2_MSG_CHANNEL_REQUEST);
packet_put_int(c->remote_id);
packet_put_cstring(service);
@@ -738,7 +738,7 @@ channel_pre_input_draining(Channel *c, fd_set * readset, fd_set * writeset)
packet_put_int(c->remote_id);
packet_send();
c->type = SSH_CHANNEL_CLOSED;
- debug("channel %d: closing after input drain.", c->self);
+ debug2("channel %d: closing after input drain.", c->self);
}
}
@@ -779,7 +779,7 @@ x11_open_helper(Buffer *b)
proto_len = ucp[6] + 256 * ucp[7];
data_len = ucp[8] + 256 * ucp[9];
} else {
- debug("Initial X11 packet contains bad byte order byte: 0x%x",
+ debug2("Initial X11 packet contains bad byte order byte: 0x%x",
ucp[0]);
return -1;
}
@@ -792,14 +792,14 @@ x11_open_helper(Buffer *b)
/* Check if authentication protocol matches. */
if (proto_len != strlen(x11_saved_proto) ||
memcmp(ucp + 12, x11_saved_proto, proto_len) != 0) {
- debug("X11 connection uses different authentication protocol.");
+ debug2("X11 connection uses different authentication protocol.");
return -1;
}
/* Check if authentication data matches our fake data. */
if (data_len != x11_fake_data_len ||
memcmp(ucp + 12 + ((proto_len + 3) & ~3),
x11_fake_data, x11_fake_data_len) != 0) {
- debug("X11 auth data does not match fake data.");
+ debug2("X11 auth data does not match fake data.");
return -1;
}
/* Check fake data length */
@@ -856,7 +856,7 @@ channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset)
channel_pre_open(c, readset, writeset);
} else if (ret == -1) {
logit("X11 connection rejected because of wrong authentication.");
- debug("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate);
+ debug2("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate);
chan_read_failed(c);
buffer_clear(&c->input);
chan_ibuf_empty(c);
@@ -866,7 +866,7 @@ channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset)
chan_write_failed(c);
else
c->type = SSH_CHANNEL_OPEN;
- debug("X11 closed %d i%d/o%d", c->self, c->istate, c->ostate);
+ debug2("X11 closed %d i%d/o%d", c->self, c->istate, c->ostate);
}
}
@@ -924,7 +924,7 @@ channel_decode_socks4(Channel *c, fd_set * readset, fd_set * writeset)
strlcpy(c->path, host, sizeof(c->path));
c->host_port = ntohs(s4_req.dest_port);
- debug("channel %d: dynamic request: socks4 host %s port %u command %u",
+ debug2("channel %d: dynamic request: socks4 host %s port %u command %u",
c->self, host, c->host_port, s4_req.command);
if (s4_req.command != 1) {
@@ -1001,7 +1001,7 @@ channel_decode_socks5(Channel *c, fd_set * readset, fd_set * writeset)
if (s5_req.version != 0x05 ||
s5_req.command != SSH_SOCKS5_CONNECT ||
s5_req.reserved != 0x00) {
- debug("channel %d: only socks5 connect supported", c->self);
+ debug2("channel %d: only socks5 connect supported", c->self);
return -1;
}
switch(s5_req.atyp){
@@ -1018,7 +1018,7 @@ channel_decode_socks5(Channel *c, fd_set * readset, fd_set * writeset)
af = AF_INET6;
break;
default:
- debug("channel %d: bad socks5 atyp %d", c->self, s5_req.atyp);
+ debug2("channel %d: bad socks5 atyp %d", c->self, s5_req.atyp);
return -1;
}
if (have < 4 + addrlen + 2)
@@ -1035,7 +1035,7 @@ channel_decode_socks5(Channel *c, fd_set * readset, fd_set * writeset)
return -1;
c->host_port = ntohs(dest_port);
- debug("channel %d: dynamic request: socks5 host %s port %u command %u",
+ debug2("channel %d: dynamic request: socks5 host %s port %u command %u",
c->self, c->path, c->host_port, s5_req.command);
s5_rsp.version = 0x05;
@@ -1110,7 +1110,7 @@ channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset)
addrlen = sizeof(addr);
newsock = accept(c->sock, &addr, &addrlen);
if (c->single_connection) {
- debug("single_connection: closing X11 listener.");
+ debug2("single_connection: closing X11 listener.");
channel_close_fd(&c->sock);
chan_mark_dead(c);
}
@@ -1136,7 +1136,7 @@ channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset)
/* originator ipaddr and port */
packet_put_cstring(remote_ipaddr);
if (datafellows & SSH_BUG_X11FWD) {
- debug("ssh2 x11 bug compat mode");
+ debug2("ssh2 x11 bug compat mode");
} else {
packet_put_int(remote_port);
}
@@ -1355,16 +1355,16 @@ channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset)
if (len < 0 && (errno == EINTR || errno == EAGAIN))
return 1;
if (len <= 0) {
- debug("channel %d: read<=0 rfd %d len %d",
+ debug2("channel %d: read<=0 rfd %d len %d",
c->self, c->rfd, len);
if (c->type != SSH_CHANNEL_OPEN) {
- debug("channel %d: not open", c->self);
+ debug2("channel %d: not open", c->self);
chan_mark_dead(c);
return -1;
} else if (compat13) {
buffer_clear(&c->output);
c->type = SSH_CHANNEL_INPUT_DRAINING;
- debug("channel %d: input draining.", c->self);
+ debug2("channel %d: input draining.", c->self);
} else {
chan_read_failed(c);
}
@@ -1372,7 +1372,7 @@ channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset)
}
if (c->input_filter != NULL) {
if (c->input_filter(c, buf, len) == -1) {
- debug("channel %d: filter stops", c->self);
+ debug2("channel %d: filter stops", c->self);
chan_read_failed(c);
}
} else {
@@ -1400,12 +1400,12 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
return 1;
if (len <= 0) {
if (c->type != SSH_CHANNEL_OPEN) {
- debug("channel %d: not open", c->self);
+ debug2("channel %d: not open", c->self);
chan_mark_dead(c);
return -1;
} else if (compat13) {
buffer_clear(&c->output);
- debug("channel %d: input draining.", c->self);
+ debug2("channel %d: input draining.", c->self);
c->type = SSH_CHANNEL_INPUT_DRAINING;
} else {
chan_write_failed(c);
@@ -1612,16 +1612,16 @@ channel_garbage_collect(Channel *c)
if (c->detach_user != NULL) {
if (!chan_is_dead(c, 0))
return;
- debug("channel %d: gc: notify user", c->self);
+ debug2("channel %d: gc: notify user", c->self);
c->detach_user(c->self, NULL);
/* if we still have a callback */
if (c->detach_user != NULL)
return;
- debug("channel %d: gc: user detached", c->self);
+ debug2("channel %d: gc: user detached", c->self);
}
if (!chan_is_dead(c, 1))
return;
- debug("channel %d: garbage collecting", c->self);
+ debug2("channel %d: garbage collecting", c->self);
channel_free(c);
}
@@ -1996,7 +1996,7 @@ channel_input_open_confirmation(int type, u_int32_t seq, void *ctxt)
c->confirm(c->self, NULL);
debug2("callback done");
}
- debug("channel %d: open confirm rwindow %u rmax %u", c->self,
+ debug2("channel %d: open confirm rwindow %u rmax %u", c->self,
c->remote_window, c->remote_maxpacket);
}
packet_check_eom();
@@ -2489,7 +2489,7 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
return -1;
}
if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
- debug("bind port %d: %.100s", port, strerror(errno));
+ debug2("bind port %d: %.100s", port, strerror(errno));
close(sock);
if (ai->ai_next)
@@ -2629,12 +2629,12 @@ x11_connect_display(void)
/* Create a socket. */
sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if (sock < 0) {
- debug("socket: %.100s", strerror(errno));
+ debug2("socket: %.100s", strerror(errno));
continue;
}
/* Connect it to the display. */
if (connect(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
- debug("connect %.100s port %d: %.100s", buf,
+ debug2("connect %.100s port %d: %.100s", buf,
6000 + display_number, strerror(errno));
close(sock);
continue;
diff --git a/usr.bin/ssh/nchan.c b/usr.bin/ssh/nchan.c
index c91115b432e..dc3c047aea0 100644
--- a/usr.bin/ssh/nchan.c
+++ b/usr.bin/ssh/nchan.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: nchan.c,v 1.48 2003/04/08 20:21:29 itojun Exp $");
+RCSID("$OpenBSD: nchan.c,v 1.49 2003/08/29 10:04:36 markus Exp $");
#include "ssh1.h"
#include "ssh2.h"
@@ -83,7 +83,7 @@ chan_set_istate(Channel *c, u_int next)
{
if (c->istate > CHAN_INPUT_CLOSED || next > CHAN_INPUT_CLOSED)
fatal("chan_set_istate: bad state %d -> %d", c->istate, next);
- debug("channel %d: input %s -> %s", c->self, istates[c->istate],
+ debug2("channel %d: input %s -> %s", c->self, istates[c->istate],
istates[next]);
c->istate = next;
}
@@ -92,7 +92,7 @@ chan_set_ostate(Channel *c, u_int next)
{
if (c->ostate > CHAN_OUTPUT_CLOSED || next > CHAN_OUTPUT_CLOSED)
fatal("chan_set_ostate: bad state %d -> %d", c->ostate, next);
- debug("channel %d: output %s -> %s", c->self, ostates[c->ostate],
+ debug2("channel %d: output %s -> %s", c->self, ostates[c->ostate],
ostates[next]);
c->ostate = next;
}
@@ -104,7 +104,7 @@ chan_set_ostate(Channel *c, u_int next)
static void
chan_rcvd_oclose1(Channel *c)
{
- debug("channel %d: rcvd oclose", c->self);
+ debug2("channel %d: rcvd oclose", c->self);
switch (c->istate) {
case CHAN_INPUT_WAIT_OCLOSE:
chan_set_istate(c, CHAN_INPUT_CLOSED);
@@ -128,7 +128,7 @@ chan_rcvd_oclose1(Channel *c)
void
chan_read_failed(Channel *c)
{
- debug("channel %d: read failed", c->self);
+ debug2("channel %d: read failed", c->self);
switch (c->istate) {
case CHAN_INPUT_OPEN:
chan_shutdown_read(c);
@@ -143,7 +143,7 @@ chan_read_failed(Channel *c)
void
chan_ibuf_empty(Channel *c)
{
- debug("channel %d: ibuf empty", c->self);
+ debug2("channel %d: ibuf empty", c->self);
if (buffer_len(&c->input)) {
error("channel %d: chan_ibuf_empty for non empty buffer",
c->self);
@@ -169,7 +169,7 @@ chan_ibuf_empty(Channel *c)
static void
chan_rcvd_ieof1(Channel *c)
{
- debug("channel %d: rcvd ieof", c->self);
+ debug2("channel %d: rcvd ieof", c->self);
switch (c->ostate) {
case CHAN_OUTPUT_OPEN:
chan_set_ostate(c, CHAN_OUTPUT_WAIT_DRAIN);
@@ -186,7 +186,7 @@ chan_rcvd_ieof1(Channel *c)
static void
chan_write_failed1(Channel *c)
{
- debug("channel %d: write failed", c->self);
+ debug2("channel %d: write failed", c->self);
switch (c->ostate) {
case CHAN_OUTPUT_OPEN:
chan_shutdown_write(c);
@@ -207,7 +207,7 @@ chan_write_failed1(Channel *c)
void
chan_obuf_empty(Channel *c)
{
- debug("channel %d: obuf empty", c->self);
+ debug2("channel %d: obuf empty", c->self);
if (buffer_len(&c->output)) {
error("channel %d: chan_obuf_empty for non empty buffer",
c->self);
@@ -229,7 +229,7 @@ chan_obuf_empty(Channel *c)
static void
chan_send_ieof1(Channel *c)
{
- debug("channel %d: send ieof", c->self);
+ debug2("channel %d: send ieof", c->self);
switch (c->istate) {
case CHAN_INPUT_OPEN:
case CHAN_INPUT_WAIT_DRAIN:
@@ -246,7 +246,7 @@ chan_send_ieof1(Channel *c)
static void
chan_send_oclose1(Channel *c)
{
- debug("channel %d: send oclose", c->self);
+ debug2("channel %d: send oclose", c->self);
switch (c->ostate) {
case CHAN_OUTPUT_OPEN:
case CHAN_OUTPUT_WAIT_DRAIN:
@@ -268,7 +268,7 @@ chan_send_oclose1(Channel *c)
static void
chan_rcvd_close2(Channel *c)
{
- debug("channel %d: rcvd close", c->self);
+ debug2("channel %d: rcvd close", c->self);
if (c->flags & CHAN_CLOSE_RCVD)
error("channel %d: protocol error: close rcvd twice", c->self);
c->flags |= CHAN_CLOSE_RCVD;
@@ -301,7 +301,7 @@ chan_rcvd_close2(Channel *c)
static void
chan_rcvd_eof2(Channel *c)
{
- debug("channel %d: rcvd eof", c->self);
+ debug2("channel %d: rcvd eof", c->self);
c->flags |= CHAN_EOF_RCVD;
if (c->ostate == CHAN_OUTPUT_OPEN)
chan_set_ostate(c, CHAN_OUTPUT_WAIT_DRAIN);
@@ -309,7 +309,7 @@ chan_rcvd_eof2(Channel *c)
static void
chan_write_failed2(Channel *c)
{
- debug("channel %d: write failed", c->self);
+ debug2("channel %d: write failed", c->self);
switch (c->ostate) {
case CHAN_OUTPUT_OPEN:
case CHAN_OUTPUT_WAIT_DRAIN:
@@ -325,7 +325,7 @@ chan_write_failed2(Channel *c)
static void
chan_send_eof2(Channel *c)
{
- debug("channel %d: send eof", c->self);
+ debug2("channel %d: send eof", c->self);
switch (c->istate) {
case CHAN_INPUT_WAIT_DRAIN:
packet_start(SSH2_MSG_CHANNEL_EOF);
@@ -342,7 +342,7 @@ chan_send_eof2(Channel *c)
static void
chan_send_close2(Channel *c)
{
- debug("channel %d: send close", c->self);
+ debug2("channel %d: send close", c->self);
if (c->ostate != CHAN_OUTPUT_CLOSED ||
c->istate != CHAN_INPUT_CLOSED) {
error("channel %d: cannot send close for istate/ostate %d/%d",
@@ -398,13 +398,13 @@ int
chan_is_dead(Channel *c, int send)
{
if (c->type == SSH_CHANNEL_ZOMBIE) {
- debug("channel %d: zombie", c->self);
+ debug2("channel %d: zombie", c->self);
return 1;
}
if (c->istate != CHAN_INPUT_CLOSED || c->ostate != CHAN_OUTPUT_CLOSED)
return 0;
if (!compat20) {
- debug("channel %d: is dead", c->self);
+ debug2("channel %d: is dead", c->self);
return 1;
}
if ((datafellows & SSH_BUG_EXTEOF) &&
@@ -421,7 +421,7 @@ chan_is_dead(Channel *c, int send)
} else {
/* channel would be dead if we sent a close */
if (c->flags & CHAN_CLOSE_RCVD) {
- debug("channel %d: almost dead",
+ debug2("channel %d: almost dead",
c->self);
return 1;
}
@@ -429,7 +429,7 @@ chan_is_dead(Channel *c, int send)
}
if ((c->flags & CHAN_CLOSE_SENT) &&
(c->flags & CHAN_CLOSE_RCVD)) {
- debug("channel %d: is dead", c->self);
+ debug2("channel %d: is dead", c->self);
return 1;
}
return 0;
@@ -443,10 +443,10 @@ chan_shutdown_write(Channel *c)
if (compat20 && c->type == SSH_CHANNEL_LARVAL)
return;
/* shutdown failure is allowed if write failed already */
- debug("channel %d: close_write", c->self);
+ debug2("channel %d: close_write", c->self);
if (c->sock != -1) {
if (shutdown(c->sock, SHUT_WR) < 0)
- debug("channel %d: chan_shutdown_write: "
+ debug2("channel %d: chan_shutdown_write: "
"shutdown() failed for fd%d: %.100s",
c->self, c->sock, strerror(errno));
} else {
@@ -461,7 +461,7 @@ chan_shutdown_read(Channel *c)
{
if (compat20 && c->type == SSH_CHANNEL_LARVAL)
return;
- debug("channel %d: close_read", c->self);
+ debug2("channel %d: close_read", c->self);
if (c->sock != -1) {
if (shutdown(c->sock, SHUT_RD) < 0)
error("channel %d: chan_shutdown_read: "