diff options
author | ache <ache@FreeBSD.org> | 2002-01-19 18:03:11 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2002-01-19 18:03:11 +0000 |
commit | d90ac373d07296c7c6b1071c67ad8a277db44a04 (patch) | |
tree | 8515f49d4d2beadb565784a8d55eef7499955056 /lib/libpam/modules/pam_unix/pam_unix.c | |
parent | f371d337cd44507ffbccd7d9f592e9fed6356b0d (diff) | |
download | FreeBSD-src-d90ac373d07296c7c6b1071c67ad8a277db44a04.zip FreeBSD-src-d90ac373d07296c7c6b1071c67ad8a277db44a04.tar.gz |
Back out recent changes
Diffstat (limited to 'lib/libpam/modules/pam_unix/pam_unix.c')
-rw-r--r-- | lib/libpam/modules/pam_unix/pam_unix.c | 24 |
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 7afa45a..af6f989 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) |