summaryrefslogtreecommitdiffstats
path: root/auth1.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-03-13 13:19:42 +1100
committerDamien Miller <djm@mindrot.org>2002-03-13 13:19:42 +1100
commit3a5b0233306a3db3a5db5b9ddc187c55e9b251f4 (patch)
tree86478addb63771a9a1be0e13cfbdea9f964f963a /auth1.c
parent3225fb454d0e79cf6f824dd00ff478749620277b (diff)
Stupid djm commits experimental code to head instead of branch
revert
Diffstat (limited to 'auth1.c')
-rw-r--r--auth1.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/auth1.c b/auth1.c
index c52f6389..c2d99895 100644
--- a/auth1.c
+++ b/auth1.c
@@ -26,13 +26,8 @@ RCSID("$OpenBSD: auth1.c,v 1.35 2002/02/03 17:53:25 markus Exp $");
#include "session.h"
#include "misc.h"
#include "uidswap.h"
-#include "monitor.h"
-#include "monitor_wrap.h"
/* import */
-extern int use_privsep;
-extern int mm_recvfd;
-
extern ServerOptions options;
/*
@@ -360,13 +355,12 @@ do_authloop(Authctxt *authctxt)
* Performs authentication of an incoming connection. Session key has already
* been exchanged and encryption is enabled.
*/
-Authctxt *
+void
do_authentication(void)
{
Authctxt *authctxt;
- struct passwd *pw = NULL, *pwent;
+ struct passwd *pw;
u_int ulen;
- int allowed;
char *p, *user, *style = NULL;
/* Get the name of the user that we wish to log in as. */
@@ -388,26 +382,17 @@ do_authentication(void)
authctxt->style = style;
/* Verify that the user is a valid user. */
- if (!use_privsep) {
- pwent = getpwnam(user);
- allowed = pwent ? allowed_user(pwent) : 0;
- } else
- pwent = mm_getpwnamallow(mm_recvfd, user, &allowed);
- if (pwent && allowed) {
+ pw = getpwnam(user);
+ if (pw && allowed_user(pw)) {
authctxt->valid = 1;
- pw = pwcopy(pwent);
+ pw = pwcopy(pw);
} else {
debug("do_authentication: illegal user %s", user);
pw = NULL;
}
- /* Free memory */
- if (use_privsep)
- pwfree(pwent);
-
authctxt->pw = pw;
- setproctitle("%s%s", use_privsep ? " [net]" : "",
- pw ? user : "unknown");
+ setproctitle("%s", pw ? user : "unknown");
#ifdef USE_PAM
start_pam(pw == NULL ? "NOUSER" : user);
@@ -433,5 +418,6 @@ do_authentication(void)
packet_send();
packet_write_wait();
- return (authctxt);
+ /* Perform session preparation. */
+ do_authenticated(authctxt);
}