svn commit: r223130 - user/brooks/openssh-hpn
Bjoern A. Zeeb
bz at FreeBSD.org
Wed Jun 15 23:41:26 UTC 2011
Author: bz
Date: Wed Jun 15 23:41:25 2011
New Revision: 223130
URL: http://svn.freebsd.org/changeset/base/223130
Log:
Manually backout openssh5.8-server-logging.diff which was distributed
within openssh5.8-dynwindow_noneswitch.diff.
Modified:
user/brooks/openssh-hpn/auth2.c
user/brooks/openssh-hpn/channels.c
user/brooks/openssh-hpn/channels.h
user/brooks/openssh-hpn/kex.c
user/brooks/openssh-hpn/packet.c
user/brooks/openssh-hpn/packet.h
user/brooks/openssh-hpn/serverloop.c
user/brooks/openssh-hpn/sshd.c
Modified: user/brooks/openssh-hpn/auth2.c
==============================================================================
--- user/brooks/openssh-hpn/auth2.c Wed Jun 15 23:38:15 2011 (r223129)
+++ user/brooks/openssh-hpn/auth2.c Wed Jun 15 23:41:25 2011 (r223130)
@@ -218,7 +218,6 @@ input_userauth_request(int type, u_int32
Authmethod *m = NULL;
char *user, *service, *method, *style = NULL;
int authenticated = 0;
- static int log_flag = 0;
if (authctxt == NULL)
fatal("input_userauth_request: no authctxt");
@@ -227,11 +226,6 @@ input_userauth_request(int type, u_int32
service = packet_get_cstring(NULL);
method = packet_get_cstring(NULL);
debug("userauth-request for user %s service %s method %s", user, service, method);
- if (!log_flag) {
- logit("SSH: Server;Ltype: Authname;Remote: %s-%d;Name: %s",
- get_remote_ipaddr(), get_remote_port(), user);
- log_flag = 1;
- }
debug("attempt %d failures %d", authctxt->attempt, authctxt->failures);
if ((style = strchr(user, ':')) != NULL)
Modified: user/brooks/openssh-hpn/channels.c
==============================================================================
--- user/brooks/openssh-hpn/channels.c Wed Jun 15 23:38:15 2011 (r223129)
+++ user/brooks/openssh-hpn/channels.c Wed Jun 15 23:41:25 2011 (r223130)
@@ -2166,12 +2166,11 @@ channel_after_select(fd_set *readset, fd
/* If there is data to send to the connection, enqueue some of it now. */
-int
+void
channel_output_poll(void)
{
Channel *c;
u_int i, len;
- int packet_length = 0;
for (i = 0; i < channels_alloc; i++) {
c = channels[i];
@@ -2219,7 +2218,7 @@ channel_output_poll(void)
packet_start(SSH2_MSG_CHANNEL_DATA);
packet_put_int(c->remote_id);
packet_put_string(data, dlen);
- packet_length = packet_send();
+ packet_send();
c->remote_window -= dlen + 4;
xfree(data);
}
@@ -2249,7 +2248,7 @@ channel_output_poll(void)
SSH2_MSG_CHANNEL_DATA : SSH_MSG_CHANNEL_DATA);
packet_put_int(c->remote_id);
packet_put_string(buffer_ptr(&c->input), len);
- packet_length = packet_send();
+ packet_send();
buffer_consume(&c->input, len);
c->remote_window -= len;
}
@@ -2284,13 +2283,12 @@ channel_output_poll(void)
packet_put_int(c->remote_id);
packet_put_int(SSH2_EXTENDED_DATA_STDERR);
packet_put_string(buffer_ptr(&c->extended), len);
- packet_length = packet_send();
+ packet_send();
buffer_consume(&c->extended, len);
c->remote_window -= len;
debug2("channel %d: sent ext data %d", c->self, len);
}
}
- return (packet_length);
}
Modified: user/brooks/openssh-hpn/channels.h
==============================================================================
--- user/brooks/openssh-hpn/channels.h Wed Jun 15 23:38:15 2011 (r223129)
+++ user/brooks/openssh-hpn/channels.h Wed Jun 15 23:41:25 2011 (r223130)
@@ -239,7 +239,7 @@ void channel_input_status_confirm(int,
void channel_prepare_select(fd_set **, fd_set **, int *, u_int*, int);
void channel_after_select(fd_set *, fd_set *);
-int channel_output_poll(void);
+void channel_output_poll(void);
int channel_not_very_much_buffered_data(void);
void channel_close_all(void);
Modified: user/brooks/openssh-hpn/kex.c
==============================================================================
--- user/brooks/openssh-hpn/kex.c Wed Jun 15 23:38:15 2011 (r223129)
+++ user/brooks/openssh-hpn/kex.c Wed Jun 15 23:41:25 2011 (r223130)
@@ -49,7 +49,6 @@
#include "dispatch.h"
#include "monitor.h"
#include "roaming.h"
-#include "canohost.h"
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
# if defined(HAVE_EVP_SHA256)
@@ -409,7 +408,6 @@ kex_choose_conf(Kex *kex)
int nenc, nmac, ncomp;
u_int mode, ctos, need;
int first_kex_follows, type;
- int log_flag = 0;
int auth_flag;
@@ -463,23 +461,6 @@ kex_choose_conf(Kex *kex)
newkeys->enc.name,
newkeys->mac.name,
newkeys->comp.name);
- /*
- * client starts withctos = 0 && log flag = 0 and no log
- * 2nd client pass ctos=1 and flag = 1 so no log
- * server starts with ctos =1 && log_flag = 0 so log
- * 2nd sever pass ctos = 1 && log flag = 1 so no log
- * -cjr
- */
- if (ctos && !log_flag) {
- logit("SSH: Server;Ltype: Kex;Remote: %s-%d;"
- "Enc: %s;MAC: %s;Comp: %s",
- get_remote_ipaddr(),
- get_remote_port(),
- newkeys->enc.name,
- newkeys->mac.name,
- newkeys->comp.name);
- }
- log_flag = 1;
}
choose_kex(kex, cprop[PROPOSAL_KEX_ALGS], sprop[PROPOSAL_KEX_ALGS]);
choose_hostkeyalg(kex, cprop[PROPOSAL_SERVER_HOST_KEY_ALGS],
Modified: user/brooks/openssh-hpn/packet.c
==============================================================================
--- user/brooks/openssh-hpn/packet.c Wed Jun 15 23:38:15 2011 (r223129)
+++ user/brooks/openssh-hpn/packet.c Wed Jun 15 23:41:25 2011 (r223130)
@@ -842,7 +842,7 @@ packet_enable_delayed_compress(void)
/*
* Finalize packet in SSH2 format (compress, mac, encrypt, enqueue)
*/
-static int
+static void
packet_send2_wrapped(void)
{
u_char type, *cp, *macbuf = NULL;
@@ -961,13 +961,11 @@ packet_send2_wrapped(void)
set_newkeys(MODE_OUT);
else if (type == SSH2_MSG_USERAUTH_SUCCESS && active_state->server_side)
packet_enable_delayed_compress();
- return(packet_length);
}
-static int
+static void
packet_send2(void)
{
- static int packet_length = 0;
struct packet *p;
u_char type, *cp;
@@ -985,7 +983,7 @@ packet_send2(void)
sizeof(Buffer));
buffer_init(&active_state->outgoing_packet);
TAILQ_INSERT_TAIL(&active_state->outgoing, p, next);
- return(sizeof(Buffer));
+ return;
}
}
@@ -993,7 +991,7 @@ packet_send2(void)
if (type == SSH2_MSG_KEXINIT)
active_state->rekeying = 1;
- packet_length = packet_send2_wrapped();
+ packet_send2_wrapped();
/* after a NEWKEYS message we can send the complete queue */
if (type == SSH2_MSG_NEWKEYS) {
@@ -1006,22 +1004,19 @@ packet_send2(void)
sizeof(Buffer));
TAILQ_REMOVE(&active_state->outgoing, p, next);
xfree(p);
- packet_length += packet_send2_wrapped();
+ packet_send2_wrapped();
}
}
- return(packet_length);
}
-int
+void
packet_send(void)
{
- int packet_len = 0;
if (compat20)
- packet_len = packet_send2();
+ packet_send2();
else
packet_send1();
DBG(debug("packet_send done"));
- return(packet_len);
}
/*
@@ -1660,7 +1655,7 @@ packet_disconnect(const char *fmt,...)
/* Checks if there is any buffered output, and tries to write some of the output. */
-int
+void
packet_write_poll(void)
{
int len = buffer_len(&active_state->output);
@@ -1673,14 +1668,13 @@ packet_write_poll(void)
if (len == -1) {
if (errno == EINTR || errno == EAGAIN ||
errno == EWOULDBLOCK)
- return(0);
+ return;
fatal("Write failed: %.100s", strerror(errno));
}
if (len == 0 && !cont)
fatal("Write connection closed");
buffer_consume(&active_state->output, len);
}
- return(len);
}
/*
Modified: user/brooks/openssh-hpn/packet.h
==============================================================================
--- user/brooks/openssh-hpn/packet.h Wed Jun 15 23:38:15 2011 (r223129)
+++ user/brooks/openssh-hpn/packet.h Wed Jun 15 23:41:25 2011 (r223130)
@@ -55,7 +55,7 @@ void packet_put_ecpoint(const EC_GRO
void packet_put_string(const void *buf, u_int len);
void packet_put_cstring(const char *str);
void packet_put_raw(const void *buf, u_int len);
-int packet_send(void);
+void packet_send(void);
int packet_read(void);
void packet_read_expect(int type);
@@ -90,7 +90,7 @@ int packet_get_ssh1_cipher(void);
void packet_set_iv(int, u_char *);
void *packet_get_newkeys(int);
-int packet_write_poll(void);
+void packet_write_poll(void);
void packet_write_wait(void);
int packet_have_data_to_write(void);
int packet_not_very_much_data_to_write(void);
Modified: user/brooks/openssh-hpn/serverloop.c
==============================================================================
--- user/brooks/openssh-hpn/serverloop.c Wed Jun 15 23:38:15 2011 (r223129)
+++ user/brooks/openssh-hpn/serverloop.c Wed Jun 15 23:41:25 2011 (r223130)
@@ -94,11 +94,10 @@ static int fdin; /* Descriptor for stdi
static int fdout; /* Descriptor for stdout (for reading);
May be same number as fdin. */
static int fderr; /* Descriptor for stderr. May be -1. */
-/* XXX should this really be u_long? Why not int64_t? */
-static u_long stdin_bytes = 0; /* Number of bytes written to stdin. */
-static u_long stdout_bytes = 0; /* Number of stdout bytes sent to client. */
-static u_long stderr_bytes = 0; /* Number of stderr bytes sent to client. */
-static u_long fdout_bytes = 0; /* Number of stdout bytes read from program. */
+static int stdin_bytes = 0; /* Number of bytes written to stdin. */
+static int stdout_bytes = 0; /* Number of stdout bytes sent to client. */
+static int stderr_bytes = 0; /* Number of stderr bytes sent to client. */
+static int fdout_bytes = 0; /* Number of stdout bytes read from program. */
static int stdin_eof = 0; /* EOF message received from client. */
static int fdout_eof = 0; /* EOF encountered reading from fdout. */
static int fderr_eof = 0; /* EOF encountered readung from fderr. */
@@ -123,19 +122,6 @@ static volatile sig_atomic_t received_si
static void server_init_dispatch(void);
/*
- * Returns current time in seconds from Jan 1, 1970 with the maximum
- * available resolution.
- */
-
-static double
-get_current_time(void)
-{
- struct timeval tv;
- gettimeofday(&tv, NULL);
- return (double) tv.tv_sec + (double) tv.tv_usec / 1000000.0;
-}
-
-/*
* we write to this pipe if a SIGCHLD is caught in order to avoid
* the race between select() and child_terminated
*/
@@ -428,7 +414,6 @@ process_input(fd_set *readset)
} else {
/* Buffer any received data. */
packet_process_incoming(buf, len);
- fdout_bytes += len;
}
}
if (compat20)
@@ -451,7 +436,6 @@ process_input(fd_set *readset)
} else {
buffer_append(&stdout_buffer, buf, len);
fdout_bytes += len;
- debug ("FD out now: %ld", fdout_bytes);
}
}
/* Read and buffer any available stderr data from the program. */
@@ -519,7 +503,7 @@ process_output(fd_set *writeset)
}
/* Send any buffered packet data to the client. */
if (FD_ISSET(connection_out, writeset))
- stdin_bytes += packet_write_poll();
+ packet_write_poll();
}
/*
@@ -836,10 +820,8 @@ server_loop2(Authctxt *authctxt)
{
fd_set *readset = NULL, *writeset = NULL;
int rekeying = 0, max_fd, nalloc = 0;
- double start_time, total_time;
debug("Entering interactive session for SSH2.");
- start_time = get_current_time();
mysignal(SIGCHLD, sigchld_handler);
child_terminated = 0;
@@ -901,12 +883,6 @@ server_loop2(Authctxt *authctxt)
/* free remaining sessions, e.g. remove wtmp entries */
session_destroy_all(NULL);
- total_time = get_current_time() - start_time;
- logit("SSH: Server;LType: Throughput;Remote: %s-%d;"
- "IN: %lu;OUT: %lu;Duration: %.1f;tPut_in: %.1f;tPut_out: %.1f",
- get_remote_ipaddr(), get_remote_port(),
- stdin_bytes, fdout_bytes, total_time, stdin_bytes / total_time,
- fdout_bytes / total_time);
}
static void
Modified: user/brooks/openssh-hpn/sshd.c
==============================================================================
--- user/brooks/openssh-hpn/sshd.c Wed Jun 15 23:38:15 2011 (r223129)
+++ user/brooks/openssh-hpn/sshd.c Wed Jun 15 23:41:25 2011 (r223130)
@@ -469,10 +469,6 @@ sshd_exchange_identification(int sock_in
}
debug("Client protocol version %d.%d; client software version %.100s",
remote_major, remote_minor, remote_version);
- logit("SSH: Server;Ltype: Version;Remote: %s-%d;"
- "Protocol: %d.%d;Client: %.100s",
- get_remote_ipaddr(), get_remote_port(),
- remote_major, remote_minor, remote_version);
compat_datafellows(remote_version);
More information about the svn-src-user
mailing list