summaryrefslogtreecommitdiff
path: root/lib/libpam/modules/pam_unix/pam_unix.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2002-01-19 18:03:11 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2002-01-19 18:03:11 +0000
commit0b836dfaf1e6570013f9838aab4036f64c239a0b (patch)
tree8515f49d4d2beadb565784a8d55eef7499955056 /lib/libpam/modules/pam_unix/pam_unix.c
parentcc51a2e8b18c81832bba6159f56c00b7bfa7f793 (diff)
Notes
Diffstat (limited to 'lib/libpam/modules/pam_unix/pam_unix.c')
-rw-r--r--lib/libpam/modules/pam_unix/pam_unix.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/libpam/modules/pam_unix/pam_unix.c b/lib/libpam/modules/pam_unix/pam_unix.c
index 7afa45a9ac2f..af6f989fb48c 100644
--- a/lib/libpam/modules/pam_unix/pam_unix.c
+++ b/lib/libpam/modules/pam_unix/pam_unix.c
@@ -152,8 +152,6 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
retval = strcmp(encrypted, pwd->pw_passwd) == 0 ?
PAM_SUCCESS : PAM_AUTH_ERR;
- if (pwd->pw_expire && time(NULL) >= pwd->pw_expire)
- retval = PAM_AUTH_ERR;
}
else {
@@ -504,14 +502,15 @@ local_passwd(const char *user, const char *pass)
syslog(LOG_ERR, "cannot set password cipher");
login_close(lc);
/* Salt suitable for anything */
+ srandomdev();
gettimeofday(&tv, 0);
- to64(&salt[0], arc4random(), 3);
+ to64(&salt[0], random(), 3);
to64(&salt[3], tv.tv_usec, 3);
to64(&salt[6], tv.tv_sec, 2);
- to64(&salt[8], arc4random(), 5);
- to64(&salt[13], arc4random(), 5);
- to64(&salt[17], arc4random(), 5);
- to64(&salt[22], arc4random(), 5);
+ to64(&salt[8], random(), 5);
+ to64(&salt[13], random(), 5);
+ to64(&salt[17], random(), 5);
+ to64(&salt[22], random(), 5);
salt[27] = '\0';
pwd->pw_passwd = crypt(pass, salt);
@@ -597,14 +596,15 @@ yp_passwd(const char *user, const char *pass)
syslog(LOG_ERR, "cannot set password cipher");
login_close(lc);
/* Salt suitable for anything */
+ srandomdev();
gettimeofday(&tv, 0);
- to64(&salt[0], arc4random(), 3);
+ to64(&salt[0], random(), 3);
to64(&salt[3], tv.tv_usec, 3);
to64(&salt[6], tv.tv_sec, 2);
- to64(&salt[8], arc4random(), 5);
- to64(&salt[13], arc4random(), 5);
- to64(&salt[17], arc4random(), 5);
- to64(&salt[22], arc4random(), 5);
+ to64(&salt[8], random(), 5);
+ to64(&salt[13], random(), 5);
+ to64(&salt[17], random(), 5);
+ to64(&salt[22], random(), 5);
salt[27] = '\0';
if (suser_override)