summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ppp/auth.c')
-rw-r--r--usr.sbin/ppp/auth.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ppp/auth.c b/usr.sbin/ppp/auth.c
index 66a3de7..fbfc929 100644
--- a/usr.sbin/ppp/auth.c
+++ b/usr.sbin/ppp/auth.c
@@ -126,9 +126,11 @@ auth_CheckPasswd(const char *name, const char *data, const char *key)
/* Then look up the real password database */
struct passwd *pw;
int result;
+ char *cryptpw;
+ cryptpw = crypt(key, pw->pw_passwd);
result = (pw = getpwnam(name)) &&
- !strcmp(crypt(key, pw->pw_passwd), pw->pw_passwd);
+ (cryptpw == NULL || !strcmp(cryptpw, pw->pw_passwd));
endpwent();
return result;
#else /* !NOPAM */
OpenPOWER on IntegriCloud