diff options
author | Steve Langasek <steve.langasek@canonical.com> | 2020-08-11 14:54:35 -0700 |
---|---|---|
committer | Steve Langasek <steve.langasek@canonical.com> | 2020-08-11 15:00:33 -0700 |
commit | 239d9c3181694bda5a0531ac579612c46c3b4e6d (patch) | |
tree | 43c04725cde922627215f4c32665ea832dd456d1 /modules/pam_pwhistory/opasswd.c | |
parent | aa2142277bf5fb4a884c6119180e41258817705b (diff) | |
parent | f6d08ed47a3da3c08345bce2ca366e961c52ad7c (diff) | |
download | pam-239d9c3181694bda5a0531ac579612c46c3b4e6d.tar.gz pam-239d9c3181694bda5a0531ac579612c46c3b4e6d.tar.bz2 pam-239d9c3181694bda5a0531ac579612c46c3b4e6d.zip |
Merge upstream version 1.4.0
Diffstat (limited to 'modules/pam_pwhistory/opasswd.c')
-rw-r--r-- | modules/pam_pwhistory/opasswd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/pam_pwhistory/opasswd.c b/modules/pam_pwhistory/opasswd.c index e6cf3469..77142f2c 100644 --- a/modules/pam_pwhistory/opasswd.c +++ b/modules/pam_pwhistory/opasswd.c @@ -49,7 +49,7 @@ #include <syslog.h> #include <sys/stat.h> -#if defined (HAVE_XCRYPT_H) +#if defined HAVE_LIBXCRYPT #include <xcrypt.h> #elif defined (HAVE_CRYPT_H) #include <crypt.h> @@ -326,6 +326,9 @@ save_old_pass (pam_handle_t *pamh, const char *user, uid_t uid, n = strlen (buf); #endif /* HAVE_GETLINE / HAVE_GETDELIM */ + if (n < 1) + break; + cp = buf; save = strdup (buf); /* Copy to write the original data back. */ if (save == NULL) @@ -336,9 +339,6 @@ save_old_pass (pam_handle_t *pamh, const char *user, uid_t uid, goto error_opasswd; } - if (n < 1) - break; - tmp = strchr (cp, '#'); /* remove comments */ if (tmp) *tmp = '\0'; |