aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_unix/unix_update.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-07-15 08:00:00 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-07-15 08:00:00 +0000
commitb36351dd0137034e79194023c8d687b495e785c4 (patch)
tree66e8f8b8f5d2de2872dc18e7cb6ae8588e074905 /modules/pam_unix/unix_update.c
parent2231e9de36a80924112b09393967e0600b0cdb83 (diff)
downloadpam-b36351dd0137034e79194023c8d687b495e785c4.tar.gz
pam-b36351dd0137034e79194023c8d687b495e785c4.tar.bz2
pam-b36351dd0137034e79194023c8d687b495e785c4.zip
pam_unix: use PAM_MAX_RESP_SIZE instead of its alias MAXPASS
* modules/pam_unix/passverify.h (MAXPASS): Remove. * modules/pam_unix/passverify.c (read_passwords): Replace MAXPASS with PAM_MAX_RESP_SIZE. * modules/pam_unix/pam_unix_passwd.c (_pam_unix_approve_pass): Likewise. * modules/pam_unix/support.c (_unix_verify_password): Likewise. * modules/pam_unix/unix_chkpwd.c (main): Likewise. * modules/pam_unix/unix_update.c (set_password): Likewise.
Diffstat (limited to 'modules/pam_unix/unix_update.c')
-rw-r--r--modules/pam_unix/unix_update.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/pam_unix/unix_update.c b/modules/pam_unix/unix_update.c
index 6ea7ea51..ae77fe2e 100644
--- a/modules/pam_unix/unix_update.c
+++ b/modules/pam_unix/unix_update.c
@@ -38,8 +38,8 @@ set_password(const char *forwho, const char *shadow, const char *remember)
{
struct passwd *pwd = NULL;
int retval;
- char pass[MAXPASS + 1];
- char towhat[MAXPASS + 1];
+ char pass[PAM_MAX_RESP_SIZE + 1];
+ char towhat[PAM_MAX_RESP_SIZE + 1];
int npass = 0;
/* we don't care about number format errors because the helper
should be called internally only */
@@ -54,7 +54,7 @@ set_password(const char *forwho, const char *shadow, const char *remember)
if (npass != 2) { /* is it a valid password? */
if (npass == 1) {
helper_log_err(LOG_DEBUG, "no new password supplied");
- memset(pass, '\0', MAXPASS);
+ memset(pass, '\0', PAM_MAX_RESP_SIZE);
} else {
helper_log_err(LOG_DEBUG, "no valid passwords supplied");
}
@@ -97,8 +97,8 @@ set_password(const char *forwho, const char *shadow, const char *remember)
}
done:
- memset(pass, '\0', MAXPASS);
- memset(towhat, '\0', MAXPASS);
+ memset(pass, '\0', PAM_MAX_RESP_SIZE);
+ memset(towhat, '\0', PAM_MAX_RESP_SIZE);
unlock_pwdf();