summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/pap.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-09-27 19:11:43 +0000
committerbrian <brian@FreeBSD.org>1997-09-27 19:11:43 +0000
commiteba31c606658833edb4a1449fc8f468a18ccd422 (patch)
tree4fd1995ad719e251fe777dfade3f6b06b99c6c0c /usr.sbin/ppp/pap.c
parent09662851527f6d3ed013037c8742fe9c7178c0c6 (diff)
downloadFreeBSD-src-eba31c606658833edb4a1449fc8f468a18ccd422.zip
FreeBSD-src-eba31c606658833edb4a1449fc8f468a18ccd422.tar.gz
Don't login twice when using passwdauth
Suggested by: Peter Childs <pjchilds@imforei.apana.org.au> Merge the whole module into a few lines in pap.c
Diffstat (limited to 'usr.sbin/ppp/pap.c')
-rw-r--r--usr.sbin/ppp/pap.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.sbin/ppp/pap.c b/usr.sbin/ppp/pap.c
index 0ef06de..aad7a30 100644
--- a/usr.sbin/ppp/pap.c
+++ b/usr.sbin/ppp/pap.c
@@ -18,12 +18,13 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: pap.c,v 1.14 1997/08/25 00:29:24 brian Exp $
+ * $Id: pap.c,v 1.15 1997/09/22 23:59:15 brian Exp $
*
* TODO:
*/
#include <time.h>
#include <utmp.h>
+#include <pwd.h>
#include "fsm.h"
#include "lcp.h"
#include "pap.h"
@@ -39,10 +40,6 @@
#include "libutil.h"
#endif
-#ifndef NOPASSWDAUTH
-#include "passwdauth.h"
-#endif
-
static char *papcodes[] = {
"???", "REQUEST", "ACK", "NAK"
};
@@ -119,8 +116,14 @@ PapValidate(u_char * name, u_char * key)
#ifndef NOPASSWDAUTH
if (Enabled(ConfPasswdAuth)) {
- LogPrintf(LogLCP, "PasswdAuth enabled - calling\n");
- return PasswdAuth(name, key);
+ struct passwd *pwd;
+ int result;
+
+ LogPrintf(LogLCP, "Using PasswdAuth\n");
+ result = (pwd = getpwnam(name)) &&
+ !strcmp(crypt(key, pwd->pw_passwd), pwd->pw_passwd);
+ endpwent();
+ return result;
}
#endif
OpenPOWER on IntegriCloud