From a079e9fa4c076594f85d8691b33812e6c88e1406 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Tue, 9 Feb 2010 15:08:59 +0000 Subject: Relevant BUGIDs: Purpose of commit: bugfix Commit summary: --------------- 2010-02-09 Tomas Mraz * libpam/pam_get_authtok.c (pam_get_authtok_internal): Fix regression in the new password prompt. --- libpam/pam_get_authtok.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'libpam') diff --git a/libpam/pam_get_authtok.c b/libpam/pam_get_authtok.c index 43e33a3c..ecd29910 100644 --- a/libpam/pam_get_authtok.c +++ b/libpam/pam_get_authtok.c @@ -81,7 +81,7 @@ pam_get_authtok_internal (pam_handle_t *pamh, int item, char *resp[2] = {NULL, NULL}; const void *prevauthtok; const char *authtok_type = ""; - int ask_twice = 0; /* Password change, ask twice for it */ + int chpass = 0; /* Password change, ask twice for it */ int retval; if (authtok == NULL) @@ -91,8 +91,9 @@ pam_get_authtok_internal (pam_handle_t *pamh, int item, which needs to be verified. */ if (item == PAM_AUTHTOK && pamh->choice == PAM_CHAUTHTOK) { + chpass = 1; if (!(flags & PAM_GETAUTHTOK_NOVERIFY)) - ask_twice = 1; + ++chpass; authtok_type = get_option (pamh, "authtok_type"); if (authtok_type == NULL) @@ -110,11 +111,11 @@ pam_get_authtok_internal (pam_handle_t *pamh, int item, return PAM_SUCCESS; } else if (get_option (pamh, "use_first_pass") || - (ask_twice && get_option (pamh, "use_authtok"))) + (chpass && get_option (pamh, "use_authtok"))) { if (prevauthtok == NULL) { - if (ask_twice) + if (chpass) return PAM_AUTHTOK_ERR; else return PAM_AUTH_ERR; @@ -127,16 +128,16 @@ pam_get_authtok_internal (pam_handle_t *pamh, int item, { retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &resp[0], "%s", prompt); - if (retval == PAM_SUCCESS && ask_twice && resp[0] != NULL) + if (retval == PAM_SUCCESS && chpass > 1 && resp[0] != NULL) retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &resp[1], _("Retype %s"), prompt); } - else if (ask_twice) + else if (chpass) { retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &resp[0], PROMPT1, authtok_type, strlen (authtok_type) > 0?" ":""); - if (retval == PAM_SUCCESS && ask_twice && resp[0] != NULL) + if (retval == PAM_SUCCESS && chpass > 1 && resp[0] != NULL) retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &resp[1], PROMPT2, authtok_type, strlen (authtok_type) > 0?" ":""); @@ -146,14 +147,14 @@ pam_get_authtok_internal (pam_handle_t *pamh, int item, PROMPT); if (retval != PAM_SUCCESS || resp[0] == NULL || - (ask_twice && resp[1] == NULL)) + (chpass > 1 && resp[1] == NULL)) { /* We want to abort the password change */ pam_error (pamh, _("Password change aborted.")); return PAM_AUTHTOK_ERR; } - if (ask_twice && strcmp (resp[0], resp[1]) != 0) + if (chpass > 1 && strcmp (resp[0], resp[1]) != 0) { pam_error (pamh, MISTYPED_PASS); _pam_overwrite (resp[0]); -- cgit v1.2.3 From 08e55be772e8dabf62dc21010751a80ed905f750 Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Tue, 31 Aug 2010 11:20:59 +0000 Subject: Relevant BUGIDs: Purpose of commit: new release Commit summary: --------------- 2010-08-31 Thorsten Kukuk * release version 1.1.2 * configure.in: Bump version number. * NEWS: Document changes since 1.1.1. * doc/adg/Linux-PAM_ADG.xml: Bump version number. * doc/mwg/Linux-PAM_MWG.xml: Likewise. * doc/sag/Linux-PAM_SAG.xml: Likewise. * libpam/Makefile.am: Bump revision of shared library. * po/*.po: Regenerate. --- libpam/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpam') diff --git a/libpam/Makefile.am b/libpam/Makefile.am index 155db5b3..57bd8109 100644 --- a/libpam/Makefile.am +++ b/libpam/Makefile.am @@ -20,7 +20,7 @@ include_HEADERS = include/security/_pam_compat.h \ noinst_HEADERS = pam_prelude.h pam_private.h pam_tokens.h \ pam_modutil_private.h pam_static_modules.h -libpam_la_LDFLAGS = -no-undefined -version-info 82:2:82 +libpam_la_LDFLAGS = -no-undefined -version-info 82:3:82 libpam_la_LIBADD = @LIBAUDIT@ $(LIBPRELUDE_LIBS) @LIBDL@ if STATIC_MODULES -- cgit v1.2.3