Polish diff against upstream.
- Revert unneeded whitespace changes. - Revert modifications to loginrec.c, as the upstream version already does the right thing. - Fix indentation and whitespace of local changes. Approved by: des MFC after: 1 month
This commit is contained in:
parent
0eddfb0608
commit
35762f5913
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=231584
@ -223,8 +223,8 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt)
|
||||
login_cap_t *lc;
|
||||
const char *from_host, *from_ip;
|
||||
|
||||
from_host = get_canonical_hostname(options.use_dns);
|
||||
from_ip = get_remote_ipaddr();
|
||||
from_host = get_canonical_hostname(options.use_dns);
|
||||
from_ip = get_remote_ipaddr();
|
||||
#endif
|
||||
|
||||
if (authctxt == NULL)
|
||||
@ -272,23 +272,23 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt)
|
||||
}
|
||||
|
||||
#ifdef HAVE_LOGIN_CAP
|
||||
if (authctxt->pw != NULL) {
|
||||
lc = login_getpwclass(authctxt->pw);
|
||||
if (lc == NULL)
|
||||
lc = login_getclassbyname(NULL, authctxt->pw);
|
||||
if (!auth_hostok(lc, from_host, from_ip)) {
|
||||
logit("Denied connection for %.200s from %.200s [%.200s].",
|
||||
authctxt->pw->pw_name, from_host, from_ip);
|
||||
packet_disconnect("Sorry, you are not allowed to connect.");
|
||||
}
|
||||
if (!auth_timeok(lc, time(NULL))) {
|
||||
logit("LOGIN %.200s REFUSED (TIME) FROM %.200s",
|
||||
authctxt->pw->pw_name, from_host);
|
||||
packet_disconnect("Logins not available right now.");
|
||||
}
|
||||
login_close(lc);
|
||||
lc = NULL;
|
||||
}
|
||||
if (authctxt->pw != NULL) {
|
||||
lc = login_getpwclass(authctxt->pw);
|
||||
if (lc == NULL)
|
||||
lc = login_getclassbyname(NULL, authctxt->pw);
|
||||
if (!auth_hostok(lc, from_host, from_ip)) {
|
||||
logit("Denied connection for %.200s from %.200s [%.200s].",
|
||||
authctxt->pw->pw_name, from_host, from_ip);
|
||||
packet_disconnect("Sorry, you are not allowed to connect.");
|
||||
}
|
||||
if (!auth_timeok(lc, time(NULL))) {
|
||||
logit("LOGIN %.200s REFUSED (TIME) FROM %.200s",
|
||||
authctxt->pw->pw_name, from_host);
|
||||
packet_disconnect("Logins not available right now.");
|
||||
}
|
||||
login_close(lc);
|
||||
lc = NULL;
|
||||
}
|
||||
#endif /* HAVE_LOGIN_CAP */
|
||||
|
||||
/* reset state */
|
||||
|
@ -2690,7 +2690,7 @@ channel_set_af(int af)
|
||||
void
|
||||
channel_set_hpn(int disabled, u_int buf_size)
|
||||
{
|
||||
hpn_disabled = disabled;
|
||||
hpn_disabled = disabled;
|
||||
buffer_size = buf_size;
|
||||
debug("HPN Disabled: %d, HPN Buffer Size: %d",
|
||||
hpn_disabled, buffer_size);
|
||||
@ -2856,10 +2856,10 @@ channel_setup_fwd_listener(int type, const char *listen_addr,
|
||||
c = channel_new("port listener", type, sock, sock, -1,
|
||||
CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT,
|
||||
0, "port listener", 1);
|
||||
else
|
||||
c = channel_new("port listener", type, sock, sock, -1,
|
||||
buffer_size, CHAN_TCP_PACKET_DEFAULT,
|
||||
0, "port listener", 1);
|
||||
else
|
||||
c = channel_new("port listener", type, sock, sock, -1,
|
||||
buffer_size, CHAN_TCP_PACKET_DEFAULT,
|
||||
0, "port listener", 1);
|
||||
c->path = xstrdup(host);
|
||||
c->host_port = port_to_connect;
|
||||
c->listening_port = listen_port;
|
||||
|
@ -126,7 +126,7 @@ struct Channel {
|
||||
u_int local_window_max;
|
||||
u_int local_consumed;
|
||||
u_int local_maxpacket;
|
||||
u_int tcpwinsz;
|
||||
u_int tcpwinsz;
|
||||
int dynamic_window;
|
||||
int extended_usage;
|
||||
int single_connection;
|
||||
@ -165,13 +165,10 @@ struct Channel {
|
||||
/* default window/packet sizes for tcp/x11-fwd-channel */
|
||||
#define CHAN_SES_PACKET_DEFAULT (32*1024)
|
||||
#define CHAN_SES_WINDOW_DEFAULT (64*CHAN_SES_PACKET_DEFAULT)
|
||||
|
||||
#define CHAN_TCP_PACKET_DEFAULT (32*1024)
|
||||
#define CHAN_TCP_WINDOW_DEFAULT (64*CHAN_TCP_PACKET_DEFAULT)
|
||||
|
||||
#define CHAN_X11_PACKET_DEFAULT (16*1024)
|
||||
#define CHAN_X11_WINDOW_DEFAULT (4*CHAN_X11_PACKET_DEFAULT)
|
||||
|
||||
#define CHAN_HPN_MIN_WINDOW_DEFAULT (2*1024*1024)
|
||||
|
||||
/* possible input states */
|
||||
@ -302,6 +299,7 @@ void chan_write_failed(Channel *);
|
||||
void chan_obuf_empty(Channel *);
|
||||
|
||||
/* hpn handler */
|
||||
void channel_set_hpn(int, u_int);
|
||||
|
||||
void channel_set_hpn(int, u_int);
|
||||
|
||||
#endif
|
||||
|
@ -146,7 +146,6 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
__RCSID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@ -516,10 +515,6 @@ getlast_entry(struct logininfo *li)
|
||||
return (utmpx_get_entry(li));
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
return (utmpx_get_entry(li));
|
||||
#endif
|
||||
|
||||
#if defined(DISABLE_LASTLOG)
|
||||
/* On some systems we shouldn't even try to obtain last login
|
||||
* time, e.g. AIX */
|
||||
|
@ -264,6 +264,7 @@ static struct {
|
||||
{ "noneswitch", oNoneSwitch },
|
||||
#endif
|
||||
{ "versionaddendum", oVersionAddendum },
|
||||
|
||||
{ NULL, oBadOption }
|
||||
};
|
||||
|
||||
@ -1094,7 +1095,7 @@ process_config_line(Options *options, const char *host,
|
||||
goto parse_flag;
|
||||
|
||||
/*
|
||||
* We check to see if the command comes from the command line or not.
|
||||
* We check to see if the command comes from the command line or not.
|
||||
* If it does then enable it otherwise fail. NONE must never be a
|
||||
* default configuration.
|
||||
*/
|
||||
@ -1110,7 +1111,7 @@ process_config_line(Options *options, const char *host,
|
||||
"from the command line", filename);
|
||||
error("Continuing...");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
case oVersionAddendum:
|
||||
@ -1458,7 +1459,7 @@ fill_default_options(Options * options)
|
||||
/* options->host_key_alias should not be set by default */
|
||||
/* options->preferred_authentications will be set in ssh */
|
||||
if (options->hpn_disabled == -1)
|
||||
options->hpn_disabled = 0;
|
||||
options->hpn_disabled = 0;
|
||||
if (options->hpn_buffer_size > -1)
|
||||
{
|
||||
u_int maxlen;
|
||||
|
@ -133,6 +133,7 @@ typedef struct {
|
||||
int visual_host_key;
|
||||
|
||||
int use_roaming;
|
||||
|
||||
int request_tty;
|
||||
|
||||
int hpn_disabled; /* Switch to disable HPN buffer management. */
|
||||
|
@ -166,7 +166,7 @@ fill_default_server_options(ServerOptions *options)
|
||||
_PATH_HOST_KEY_FILE;
|
||||
if (options->protocol & SSH_PROTO_2) {
|
||||
options->host_key_files[options->num_host_key_files++] =
|
||||
_PATH_HOST_RSA_KEY_FILE;
|
||||
_PATH_HOST_RSA_KEY_FILE;
|
||||
options->host_key_files[options->num_host_key_files++] =
|
||||
_PATH_HOST_DSA_KEY_FILE;
|
||||
#ifdef OPENSSL_HAS_ECC
|
||||
|
@ -1461,6 +1461,7 @@ ssh_session2_open(void)
|
||||
c->dynamic_window = 1;
|
||||
debug("Enabled Dynamic Window Scaling\n");
|
||||
}
|
||||
|
||||
debug3("ssh_session2_open: channel_new: %d", c->self);
|
||||
|
||||
channel_send_open(c->self);
|
||||
|
@ -2,11 +2,11 @@
|
||||
/* $FreeBSD$ */
|
||||
|
||||
#ifndef SSH_VERSION
|
||||
#define SSH_VERSION_BASE "OpenSSH_5.9p1"
|
||||
#define SSH_VERSION_ADDENDUM "FreeBSD-20111001"
|
||||
#define SSH_VERSION_BASE "OpenSSH_5.9p1"
|
||||
#define SSH_VERSION_ADDENDUM "FreeBSD-20111001"
|
||||
#define SSH_VERSION_HPN "_hpn13v11"
|
||||
#define SSH_VERSION SSH_VERSION_BASE SSH_VERSION_HPN " " SSH_VERSION_ADDENDUM
|
||||
#define SSH_RELEASE (ssh_version_get())
|
||||
#define SSH_RELEASE (ssh_version_get())
|
||||
|
||||
const char *ssh_version_get(void);
|
||||
void ssh_version_set_addendum(const char *);
|
||||
|
Loading…
Reference in New Issue
Block a user