diff options
author | Steve Langasek <steve.langasek@ubuntu.com> | 2019-01-03 21:22:21 -0800 |
---|---|---|
committer | Steve Langasek <steve.langasek@ubuntu.com> | 2019-01-03 21:22:45 -0800 |
commit | 795badba7f95e737f979917859cd32c9bd47bcad (patch) | |
tree | 212a6a00baa11e9d0ca7bc27b12420d1dce6f07c /modules/pam_pwhistory/opasswd.c | |
parent | c55c14c5c6762139ec6695d84ea0e2e917da5264 (diff) | |
parent | ba315ae8effdcad591608c99452dad05c4cf20ab (diff) |
New upstream version 1.1.8
Diffstat (limited to 'modules/pam_pwhistory/opasswd.c')
-rw-r--r-- | modules/pam_pwhistory/opasswd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/pam_pwhistory/opasswd.c b/modules/pam_pwhistory/opasswd.c index 738483ac..836d713e 100644 --- a/modules/pam_pwhistory/opasswd.c +++ b/modules/pam_pwhistory/opasswd.c @@ -108,13 +108,13 @@ compare_password(const char *newpass, const char *oldpass) outval = crypt (newpass, oldpass); #endif - return strcmp(outval, oldpass) == 0; + return outval != NULL && strcmp(outval, oldpass) == 0; } /* Check, if the new password is already in the opasswd file. */ int -check_old_password (pam_handle_t *pamh, const char *user, - const char *newpass, int debug) +check_old_pass (pam_handle_t *pamh, const char *user, + const char *newpass, int debug) { int retval = PAM_SUCCESS; FILE *oldpf; @@ -209,8 +209,8 @@ check_old_password (pam_handle_t *pamh, const char *user, } int -save_old_password (pam_handle_t *pamh, const char *user, uid_t uid, - const char *oldpass, int howmany, int debug UNUSED) +save_old_pass (pam_handle_t *pamh, const char *user, uid_t uid, + const char *oldpass, int howmany, int debug UNUSED) { char opasswd_tmp[] = TMP_PASSWORDS_FILE; struct stat opasswd_stat; @@ -395,7 +395,7 @@ save_old_password (pam_handle_t *pamh, const char *user, uid_t uid, entry.user, entry.uid, entry.count, oldpass) < 0) { - free (save); + free (save); retval = PAM_AUTHTOK_ERR; fclose (oldpf); fclose (newpf); @@ -408,7 +408,7 @@ save_old_password (pam_handle_t *pamh, const char *user, uid_t uid, entry.user, entry.uid, entry.count, entry.old_passwords, oldpass) < 0) { - free (save); + free (save); retval = PAM_AUTHTOK_ERR; fclose (oldpf); fclose (newpf); |