Changeset View
Changeset View
Standalone View
Standalone View
crypto/openssh/sshd.c
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | |||||
#include "monitor.h" | #include "monitor.h" | ||||
#ifdef GSSAPI | #ifdef GSSAPI | ||||
#include "ssh-gss.h" | #include "ssh-gss.h" | ||||
#endif | #endif | ||||
#include "monitor_wrap.h" | #include "monitor_wrap.h" | ||||
#include "ssh-sandbox.h" | #include "ssh-sandbox.h" | ||||
#include "version.h" | #include "version.h" | ||||
#include "ssherr.h" | #include "ssherr.h" | ||||
#include "blacklist_client.h" | |||||
#ifdef LIBWRAP | #ifdef LIBWRAP | ||||
#include <tcpd.h> | #include <tcpd.h> | ||||
#include <syslog.h> | #include <syslog.h> | ||||
int allow_severity; | int allow_severity; | ||||
int deny_severity; | int deny_severity; | ||||
#endif /* LIBWRAP */ | #endif /* LIBWRAP */ | ||||
▲ Show 20 Lines • Show All 237 Lines • ▼ Show 20 Lines | grace_alarm_handler(int sig) | ||||
* Try to kill any processes that we have spawned, E.g. authorized | * Try to kill any processes that we have spawned, E.g. authorized | ||||
* keys command helpers. | * keys command helpers. | ||||
*/ | */ | ||||
if (getpgid(0) == getpid()) { | if (getpgid(0) == getpid()) { | ||||
signal(SIGTERM, SIG_IGN); | signal(SIGTERM, SIG_IGN); | ||||
kill(0, SIGTERM); | kill(0, SIGTERM); | ||||
} | } | ||||
BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); | |||||
/* Log error and exit. */ | /* Log error and exit. */ | ||||
sigdie("Timeout before authentication for %s", get_remote_ipaddr()); | sigdie("Timeout before authentication for %s", get_remote_ipaddr()); | ||||
} | } | ||||
/* | /* | ||||
* Signal handler for the key regeneration alarm. Note that this | * Signal handler for the key regeneration alarm. Note that this | ||||
* alarm only occurs in the daemon waiting for connections, and it does not | * alarm only occurs in the daemon waiting for connections, and it does not | ||||
* do anything with the private key or random state before forking. | * do anything with the private key or random state before forking. | ||||
▲ Show 20 Lines • Show All 1,846 Lines • ▼ Show 20 Lines | #endif /* LIBWRAP */ | ||||
authctxt->loginmsg = &loginmsg; | authctxt->loginmsg = &loginmsg; | ||||
/* XXX global for cleanup, access from other modules */ | /* XXX global for cleanup, access from other modules */ | ||||
the_authctxt = authctxt; | the_authctxt = authctxt; | ||||
/* prepare buffer to collect messages to display to user after login */ | /* prepare buffer to collect messages to display to user after login */ | ||||
buffer_init(&loginmsg); | buffer_init(&loginmsg); | ||||
auth_debug_reset(); | auth_debug_reset(); | ||||
BLACKLIST_INIT(); | |||||
if (use_privsep) { | if (use_privsep) { | ||||
if (privsep_preauth(authctxt) == 1) | if (privsep_preauth(authctxt) == 1) | ||||
goto authenticated; | goto authenticated; | ||||
} else if (compat20 && have_agent) { | } else if (compat20 && have_agent) { | ||||
if ((r = ssh_get_authentication_socket(&auth_sock)) != 0) { | if ((r = ssh_get_authentication_socket(&auth_sock)) != 0) { | ||||
error("Unable to get agent socket: %s", ssh_err(r)); | error("Unable to get agent socket: %s", ssh_err(r)); | ||||
have_agent = 0; | have_agent = 0; | ||||
▲ Show 20 Lines • Show All 440 Lines • Show Last 20 Lines |