version 1.55, 2003/11/08 16:02:40 |
version 1.55.2.1, 2004/08/19 04:13:26 |
|
|
#include "ssh1.h" |
#include "ssh1.h" |
#include "packet.h" |
#include "packet.h" |
#include "buffer.h" |
#include "buffer.h" |
#include "mpaux.h" |
|
#include "log.h" |
#include "log.h" |
#include "servconf.h" |
#include "servconf.h" |
#include "compat.h" |
#include "compat.h" |
|
|
int type = 0; |
int type = 0; |
|
|
debug("Attempting authentication for %s%.100s.", |
debug("Attempting authentication for %s%.100s.", |
authctxt->valid ? "" : "illegal user ", authctxt->user); |
authctxt->valid ? "" : "invalid user ", authctxt->user); |
|
|
/* If the user has no password, accept authentication immediately. */ |
/* If the user has no password, accept authentication immediately. */ |
if (options.password_authentication && |
if (options.password_authentication && |
|
|
if (authenticated) |
if (authenticated) |
return; |
return; |
|
|
if (authctxt->failures++ > AUTH_FAIL_MAX) |
if (authctxt->failures++ > options.max_authtries) |
packet_disconnect(AUTH_FAIL_MSG, authctxt->user); |
packet_disconnect(AUTH_FAIL_MSG, authctxt->user); |
|
|
packet_start(SSH_SMSG_FAILURE); |
packet_start(SSH_SMSG_FAILURE); |
|
|
if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) |
if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) |
authctxt->valid = 1; |
authctxt->valid = 1; |
else { |
else { |
debug("do_authentication: illegal user %s", user); |
debug("do_authentication: invalid user %s", user); |
authctxt->pw = fakepw(); |
authctxt->pw = fakepw(); |
} |
} |
|
|
setproctitle("%s%s", authctxt->pw ? user : "unknown", |
setproctitle("%s%s", authctxt->valid ? user : "unknown", |
use_privsep ? " [net]" : ""); |
use_privsep ? " [net]" : ""); |
|
|
/* |
/* |