aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_unix/unix_update.c
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@canonical.com>2022-08-16 22:06:15 -0700
committerSteve Langasek <steve.langasek@canonical.com>2022-08-16 22:11:24 -0700
commit7561896529a7af05201dc31e959a05897ef99e19 (patch)
tree14514b088f45d4fecd3b7a6ede5e0a99f6c10f6a /modules/pam_unix/unix_update.c
parentd071f8c9829cbd60e2a98ab5e6b1ddfdffb9b549 (diff)
parent99d0d1c5c4f07332daa86e73981267a761bc966e (diff)
downloadpam-7561896529a7af05201dc31e959a05897ef99e19.tar.gz
pam-7561896529a7af05201dc31e959a05897ef99e19.tar.bz2
pam-7561896529a7af05201dc31e959a05897ef99e19.zip
Merge new upstream version 1.5.2.
Diffstat (limited to 'modules/pam_unix/unix_update.c')
-rw-r--r--modules/pam_unix/unix_update.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/pam_unix/unix_update.c b/modules/pam_unix/unix_update.c
index 6ea7ea51..3559972b 100644
--- a/modules/pam_unix/unix_update.c
+++ b/modules/pam_unix/unix_update.c
@@ -32,14 +32,15 @@
#include <security/_pam_macros.h>
#include "passverify.h"
+#include "pam_inline.h"
static int
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 */
@@ -49,12 +50,12 @@ set_password(const char *forwho, const char *shadow, const char *remember)
/* read the password from stdin (a pipe from the pam_unix module) */
- npass = read_passwords(STDIN_FILENO, 2, passwords);
+ npass = pam_read_passwords(STDIN_FILENO, 2, passwords);
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 +98,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();