commit 5fccc33d3f2aa476293505fa7dace98495dccaee
Author: Tomas Mraz <tmraz(a)fedoraproject.org>
Date: Mon Aug 13 20:06:44 2012 +0200
Respect PAM_AUTHTOK_TYPE in pam_get_authtok_verify().
libpam/pam_get_authtok.c (pam_get_authtok_internal): Set the PAM_AUTHTOK_TYPE
item when obtained from module options.
(pam_get_authtok_verify): Use the PAM_AUTHTOK_TYPE item when prompting.
libpam/pam_get_authtok.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/libpam/pam_get_authtok.c b/libpam/pam_get_authtok.c
index ecd2991..31bb162 100644
--- a/libpam/pam_get_authtok.c
+++ b/libpam/pam_get_authtok.c
@@ -102,6 +102,8 @@ pam_get_authtok_internal (pam_handle_t *pamh, int item,
if (retval != PAM_SUCCESS || authtok_type == NULL)
authtok_type = "";
}
+ else
+ pam_set_item(pamh, PAM_AUTHTOK_TYPE, authtok_type);
}
retval = pam_get_item (pamh, item, &prevauthtok);
@@ -210,6 +212,9 @@ pam_get_authtok_verify (pam_handle_t *pamh, const char **authtok,
}
else
{
+ retval = pam_get_item (pamh, PAM_AUTHTOK_TYPE, (const void **)&authtok_type);
+ if (retval != PAM_SUCCESS || authtok_type == NULL)
+ authtok_type = "";
retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &resp,
PROMPT2, authtok_type,
strlen (authtok_type) > 0?" ":"");
Show replies by date