diff options
author | maxim <maxim@FreeBSD.org> | 2002-03-05 10:50:55 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2002-03-05 10:50:55 +0000 |
commit | ee1d8d86a44692e854875c60ff7ef14f93a0678b (patch) | |
tree | 86ad8059f1ac94f244b985e767f1006e0a4475e9 /usr.sbin/pppd | |
parent | 3b8079c7278da4de0a77e7bc936c4ab6f879e081 (diff) | |
download | FreeBSD-src-ee1d8d86a44692e854875c60ff7ef14f93a0678b.zip FreeBSD-src-ee1d8d86a44692e854875c60ff7ef14f93a0678b.tar.gz |
Unbreak PAP-only authentication.
PR: i386/34607
Not objected by: peter
Approved by: ru
Obtained from: ppp-2.4.1b2
MFC after: 1 week
Diffstat (limited to 'usr.sbin/pppd')
-rw-r--r-- | usr.sbin/pppd/auth.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.sbin/pppd/auth.c b/usr.sbin/pppd/auth.c index 2a580e9..b2d43f8 100644 --- a/usr.sbin/pppd/auth.c +++ b/usr.sbin/pppd/auth.c @@ -676,11 +676,17 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg, msglen) check_access(f, filename); remote = ipwo->accept_remote? 0: ipwo->hisaddr; if (scan_authfile(f, user, our_name, remote, - secret, &addrs, filename) < 0 - || (secret[0] != 0 && (cryptpap || strcmp(passwd, secret) != 0) - && strcmp(crypt(passwd, secret), secret) != 0)) { - syslog(LOG_WARNING, "PAP authentication failure for %s", user); - ret = UPAP_AUTHNAK; + secret, &addrs, filename) < 0) { + warn("no PAP secret found for %s", user); + } else { + if (secret[0] != 0) { + /* password given in pap-secrets - must match */ + if ((cryptpap || strcmp(passwd, secret) != 0) + && strcmp(crypt(passwd, secret), secret) != 0) { + ret = UPAP_AUTHNAK; + warn("PAP authentication failure for %s", user); + } + } } fclose(f); } |