Index: modules/pam_pwhistory/pam_pwhistory.8.xml =================================================================== RCS file: /cvsroot/pam/Linux-PAM/modules/pam_pwhistory/pam_pwhistory.8.xml,v retrieving revision 1.1 diff -u -r1.1 pam_pwhistory.8.xml --- modules/pam_pwhistory/pam_pwhistory.8.xml 10 Oct 2008 06:53:45 -0000 1.1 +++ modules/pam_pwhistory/pam_pwhistory.8.xml 19 Nov 2008 14:24:00 -0000 @@ -33,6 +33,9 @@ retry=N + + type=STRING + @@ -119,6 +122,21 @@ + + + + + + + The default action is for the module to use the + following prompts when requesting passwords: + "New UNIX password: " and "Retype UNIX password: ". + The default word UNIX can + be replaced with this option. + + + + Index: modules/pam_pwhistory/pam_pwhistory.c =================================================================== RCS file: /cvsroot/pam/Linux-PAM/modules/pam_pwhistory/pam_pwhistory.c,v retrieving revision 1.1 diff -u -r1.1 pam_pwhistory.c --- modules/pam_pwhistory/pam_pwhistory.c 10 Oct 2008 06:53:45 -0000 1.1 +++ modules/pam_pwhistory/pam_pwhistory.c 19 Nov 2008 14:24:00 -0000 @@ -58,7 +58,9 @@ #include "opasswd.h" +/* For Translators: "%s%s" could be replaced with " " or "". */ #define NEW_PASSWORD_PROMPT _("New %s%spassword: ") +/* For Translators: "%s%s" could be replaced with " " or "". */ #define AGAIN_PASSWORD_PROMPT _("Retype new %s%spassword: ") #define MISTYPED_PASSWORD _("Sorry, passwords do not match.") @@ -70,6 +72,7 @@ int enforce_for_root; int remember; int tries; + const char *prompt_type; }; typedef struct options_t options_t; @@ -101,6 +104,8 @@ } else if (strcasecmp (argv, "enforce_for_root") == 0) options->enforce_for_root = 1; + else if (strncasecmp (argv, "type=", 5) == 0) + options->prompt_type = &argv[5]; else pam_syslog (pamh, LOG_ERR, "pam_pwhistory: unknown option: %s", argv); } @@ -121,6 +126,7 @@ /* Set some default values, which could be overwritten later. */ options.remember = 10; options.tries = 1; + options.prompt_type = "UNIX"; /* Parse parameters for module */ for ( ; argc-- > 0; argv++) @@ -209,7 +215,8 @@ while ((newpass == NULL) && (tries++ < options.tries)) { retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &newpass, - NEW_PASSWORD_PROMPT, "UNIX", " "); + NEW_PASSWORD_PROMPT, options.prompt_type, + strlen (options.prompt_type) > 0?" ":""); if (retval != PAM_SUCCESS) { _pam_drop (newpass); @@ -249,7 +256,9 @@ char *new2; retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &new2, - AGAIN_PASSWORD_PROMPT, "UNIX", " "); + AGAIN_PASSWORD_PROMPT, + options.prompt_type, + strlen (options.prompt_type) > 0?" ":""); if (retval != PAM_SUCCESS) return retval;