svn commit: r315907 - stable/10/contrib/openpam/lib/libpam
Dag-Erling Smørgrav
des at FreeBSD.org
Fri Mar 24 14:40:54 UTC 2017
Author: des
Date: Fri Mar 24 14:40:53 2017
New Revision: 315907
URL: https://svnweb.freebsd.org/changeset/base/315907
Log:
Subset of upstream r902 which fixes custom prompts.
PR: 216172
Modified:
stable/10/contrib/openpam/lib/libpam/pam_get_authtok.c
stable/10/contrib/openpam/lib/libpam/pam_get_user.c
Modified: stable/10/contrib/openpam/lib/libpam/pam_get_authtok.c
==============================================================================
--- stable/10/contrib/openpam/lib/libpam/pam_get_authtok.c Fri Mar 24 14:39:00 2017 (r315906)
+++ stable/10/contrib/openpam/lib/libpam/pam_get_authtok.c Fri Mar 24 14:40:53 2017 (r315907)
@@ -122,9 +122,11 @@ pam_get_authtok(pam_handle_t *pamh,
if ((promptp = openpam_get_option(pamh, prompt_option)) != NULL)
prompt = promptp;
/* no prompt provided, see if there is one tucked away somewhere */
- if (prompt == NULL)
- if (pam_get_item(pamh, pitem, &promptp) && promptp != NULL)
+ if (prompt == NULL) {
+ r = pam_get_item(pamh, pitem, &promptp);
+ if (r == PAM_SUCCESS && promptp != NULL)
prompt = promptp;
+ }
/* fall back to hardcoded default */
if (prompt == NULL)
prompt = default_prompt;
Modified: stable/10/contrib/openpam/lib/libpam/pam_get_user.c
==============================================================================
--- stable/10/contrib/openpam/lib/libpam/pam_get_user.c Fri Mar 24 14:39:00 2017 (r315906)
+++ stable/10/contrib/openpam/lib/libpam/pam_get_user.c Fri Mar 24 14:40:53 2017 (r315907)
@@ -78,10 +78,11 @@ pam_get_user(pam_handle_t *pamh,
if ((promptp = openpam_get_option(pamh, "user_prompt")) != NULL)
prompt = promptp;
/* no prompt provided, see if there is one tucked away somewhere */
- if (prompt == NULL)
- if (pam_get_item(pamh, PAM_USER_PROMPT, &promptp) &&
- promptp != NULL)
+ if (prompt == NULL) {
+ r = pam_get_item(pamh, PAM_USER_PROMPT, &promptp);
+ if (r == PAM_SUCCESS && promptp != NULL)
prompt = promptp;
+ }
/* fall back to hardcoded default */
if (prompt == NULL)
prompt = user_prompt;
More information about the svn-src-stable-10
mailing list