summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-01-19 18:29:50 +0000
committerdes <des@FreeBSD.org>2002-01-19 18:29:50 +0000
commit6f44d9644f580c480b97e8c64ced8a7be849944e (patch)
treefa0385d3ac26279ddb36eebeb49d8cc7457f1031 /libexec
parentaf75944084ffa33cf32b566956585177f41b5ad3 (diff)
downloadFreeBSD-src-6f44d9644f580c480b97e8c64ced8a7be849944e.zip
FreeBSD-src-6f44d9644f580c480b97e8c64ced8a7be849944e.tar.gz
Really back out ache's commits. These files are now precisely as they were
twentyfour hours ago, except for RCS ids.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 287436a..e421142 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1251,23 +1251,24 @@ pass(passwd)
}
#ifdef USE_PAM
rval = auth_pam(&pw, passwd);
- if (rval >= 0) {
- opieunlock();
+ opieunlock(); /* XXX */
+ if (rval == 0 || (!pwok && rval > 0))
goto skip;
- }
-#endif
+ xpasswd = crypt(passwd, pw->pw_passwd);
+#else /* !USE_PAM */
if (opieverify(&opiedata, passwd) == 0)
xpasswd = pw->pw_passwd;
- else if (pwok) {
+ else if (pwok)
xpasswd = crypt(passwd, pw->pw_passwd);
- if (passwd[0] == '\0' && pw->pw_passwd[0] != '\0')
- xpasswd = ":";
- } else {
+ else {
rval = 1;
goto skip;
}
+#endif /* !USE_PAM */
rval = strcmp(pw->pw_passwd, xpasswd);
- if (pw->pw_expire && time(NULL) >= pw->pw_expire)
+ /* The strcmp does not catch null passwords! */
+ if (*pw->pw_passwd == '\0' ||
+ (pw->pw_expire && time(NULL) >= pw->pw_expire))
rval = 1; /* failure */
skip:
/*
OpenPOWER on IntegriCloud