summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>2000-09-20 09:57:58 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>2000-09-20 09:57:58 +0000
commit68b56651b4df47b778512cbb3a85aec90f712ed1 (patch)
tree0339de21d64bcb7758d238888a6be9891c87a915 /libexec
parent4d8b2434640ee8115be2fa1e1bb8c9820782e9a6 (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c14
-rw-r--r--libexec/ftpd/popen.c1
2 files changed, 10 insertions, 5 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index b5109ca618ee..f4a40aaa7d81 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1187,11 +1187,14 @@ pass(passwd)
goto skip;
#endif
#ifdef SKEY
- rval = strcmp(skey_crypt(passwd, pw->pw_passwd, pw, pwok),
- pw->pw_passwd);
- pwok = 0;
+ if (pwok)
+ rval = strcmp(pw->pw_passwd,
+ crypt(passwd, pw->pw_passwd));
+ if (rval)
+ rval = strcmp(pw->pw_passwd,
+ skey_crypt(passwd, pw->pw_passwd, pw, pwok));
#else
- rval = strcmp(crypt(passwd, pw->pw_passwd), pw->pw_passwd);
+ rval = strcmp(pw->pw_passwd, crypt(passwd, pw->pw_passwd));
#endif
/* The strcmp does not catch null passwords! */
if (*pw->pw_passwd == '\0' ||
@@ -1219,6 +1222,9 @@ skip:
return;
}
}
+#ifdef SKEY
+ pwok = 0;
+#endif
login_attempts = 0; /* this time successful */
if (setegid((gid_t)pw->pw_gid) < 0) {
reply(550, "Can't set gid.");
diff --git a/libexec/ftpd/popen.c b/libexec/ftpd/popen.c
index 82cfd581f8db..74f34e3d9c66 100644
--- a/libexec/ftpd/popen.c
+++ b/libexec/ftpd/popen.c
@@ -142,7 +142,6 @@ ftpd_popen(program, type)
(void)close(pdes[1]);
}
if (strcmp(gargv[0], _PATH_LS) == 0) {
- extern int optreset;
/* Reset getopt for ls_main() */
optreset = optind = optopt = 1;
/* Close syslogging to remove pwd.db missing msgs */