diff options
author | ache <ache@FreeBSD.org> | 2002-01-21 19:07:15 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2002-01-21 19:07:15 +0000 |
commit | 09d8de9092fd1738b39f3d6a0b2c4a13d1f0a09f (patch) | |
tree | e6f9e50eb54a5fbd6d19cd559ac09d1637ba1c6b /libexec/ftpd | |
parent | ac843e8b7511b646a7f8c2936d56e63c78508930 (diff) | |
download | FreeBSD-src-09d8de9092fd1738b39f3d6a0b2c4a13d1f0a09f.zip FreeBSD-src-09d8de9092fd1738b39f3d6a0b2c4a13d1f0a09f.tar.gz |
Remove my workaround fallback since PAM now do it properly.
Diffstat (limited to 'libexec/ftpd')
-rw-r--r-- | libexec/ftpd/ftpd.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index e421142..287436a 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1251,24 +1251,23 @@ pass(passwd) } #ifdef USE_PAM rval = auth_pam(&pw, passwd); - opieunlock(); /* XXX */ - if (rval == 0 || (!pwok && rval > 0)) + if (rval >= 0) { + opieunlock(); goto skip; - xpasswd = crypt(passwd, pw->pw_passwd); -#else /* !USE_PAM */ + } +#endif if (opieverify(&opiedata, passwd) == 0) xpasswd = pw->pw_passwd; - else if (pwok) + else if (pwok) { xpasswd = crypt(passwd, pw->pw_passwd); - else { + if (passwd[0] == '\0' && pw->pw_passwd[0] != '\0') + xpasswd = ":"; + } else { rval = 1; goto skip; } -#endif /* !USE_PAM */ rval = strcmp(pw->pw_passwd, xpasswd); - /* The strcmp does not catch null passwords! */ - if (*pw->pw_passwd == '\0' || - (pw->pw_expire && time(NULL) >= pw->pw_expire)) + if (pw->pw_expire && time(NULL) >= pw->pw_expire) rval = 1; /* failure */ skip: /* |