version 1.137, 2019/01/19 21:37:48 |
version 1.138, 2019/01/19 21:41:18 |
|
|
#include "compat.h" |
#include "compat.h" |
#include "channels.h" |
#include "channels.h" |
|
|
#include "opacket.h" /* XXX */ |
|
extern struct ssh *active_state; /* XXX */ |
|
|
|
/* import */ |
/* import */ |
extern ServerOptions options; |
extern ServerOptions options; |
extern int use_privsep; |
extern int use_privsep; |
|
|
* Otherwise true is returned. |
* Otherwise true is returned. |
*/ |
*/ |
int |
int |
allowed_user(struct passwd * pw) |
allowed_user(struct ssh *ssh, struct passwd * pw) |
{ |
{ |
struct ssh *ssh = active_state; /* XXX */ |
|
struct stat st; |
struct stat st; |
const char *hostname = NULL, *ipaddr = NULL; |
const char *hostname = NULL, *ipaddr = NULL; |
int r; |
int r; |
|
|
} |
} |
|
|
void |
void |
auth_log(Authctxt *authctxt, int authenticated, int partial, |
auth_log(struct ssh *ssh, int authenticated, int partial, |
const char *method, const char *submethod) |
const char *method, const char *submethod) |
{ |
{ |
struct ssh *ssh = active_state; /* XXX */ |
Authctxt *authctxt = (Authctxt *)ssh->authctxt; |
int level = SYSLOG_LEVEL_VERBOSE; |
int level = SYSLOG_LEVEL_VERBOSE; |
const char *authmsg; |
const char *authmsg; |
char *extra = NULL; |
char *extra = NULL; |
|
|
} |
} |
|
|
void |
void |
auth_maxtries_exceeded(Authctxt *authctxt) |
auth_maxtries_exceeded(struct ssh *ssh) |
{ |
{ |
struct ssh *ssh = active_state; /* XXX */ |
Authctxt *authctxt = (Authctxt *)ssh->authctxt; |
|
|
error("maximum authentication attempts exceeded for " |
error("maximum authentication attempts exceeded for " |
"%s%.100s from %.200s port %d ssh2", |
"%s%.100s from %.200s port %d ssh2", |
|
|
authctxt->user, |
authctxt->user, |
ssh_remote_ipaddr(ssh), |
ssh_remote_ipaddr(ssh), |
ssh_remote_port(ssh)); |
ssh_remote_port(ssh)); |
packet_disconnect("Too many authentication failures"); |
ssh_packet_disconnect(ssh, "Too many authentication failures"); |
/* NOTREACHED */ |
/* NOTREACHED */ |
} |
} |
|
|
|
|
} |
} |
|
|
struct passwd * |
struct passwd * |
getpwnamallow(const char *user) |
getpwnamallow(struct ssh *ssh, const char *user) |
{ |
{ |
struct ssh *ssh = active_state; /* XXX */ |
|
extern login_cap_t *lc; |
extern login_cap_t *lc; |
auth_session_t *as; |
auth_session_t *as; |
struct passwd *pw; |
struct passwd *pw; |
|
|
user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); |
user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); |
return (NULL); |
return (NULL); |
} |
} |
if (!allowed_user(pw)) |
if (!allowed_user(ssh, pw)) |
return (NULL); |
return (NULL); |
if ((lc = login_getclass(pw->pw_class)) == NULL) { |
if ((lc = login_getclass(pw->pw_class)) == NULL) { |
debug("unable to get login class: %s", user); |
debug("unable to get login class: %s", user); |
|
|
} |
} |
|
|
void |
void |
auth_debug_send(void) |
auth_debug_send(struct ssh *ssh) |
{ |
{ |
struct ssh *ssh = active_state; /* XXX */ |
|
char *msg; |
char *msg; |
int r; |
int r; |
|
|