]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs:
authorTomas Mraz <tm@t8m.info>
Mon, 18 Dec 2006 13:23:58 +0000 (13:23 +0000)
committerTomas Mraz <tm@t8m.info>
Mon, 18 Dec 2006 13:23:58 +0000 (13:23 +0000)
Purpose of commit: bugfix

Commit summary:
---------------
2006-12-18  Tomas Mraz  <t8m@centrum.cz>

        * modules/pam_unix/pam_unix_passwd.c (pam_sm_chauthtok): Localize
        message printed to user.

ChangeLog
modules/pam_unix/pam_unix_passwd.c

index 9dd40636b7cd4f0bd91c8fb5a0b6ddf208880fd4..ff7e74233abcfaba62f94688ee4883a8505b4a05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-18  Tomas Mraz  <t8m@centrum.cz>
+
+       * modules/pam_unix/pam_unix_passwd.c (pam_sm_chauthtok): Localize
+       message printed to user.
+
 2006-12-13  Thorsten Kukuk  <kukuk@suse.de>
 
        * modules/pam_localuser/pam_localuser.c: Add support for session
index dcd123c8f2b09ab32a008c1ff58517a145d381d8..c7ee28c9467460fbcc7b2d96ccec1658cd5c1544 100644 (file)
@@ -1105,18 +1105,13 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
                if (_unix_blankpasswd(pamh, ctrl, user)) {
                        return PAM_SUCCESS;
                } else if (off(UNIX__IAMROOT, ctrl)) {
-
                        /* instruct user what is happening */
-#define greeting "Changing password for "
-                       Announce = (char *) malloc(sizeof(greeting) + strlen(user));
-                       if (Announce == NULL) {
+                       if (asprintf(&Announce, _("Changing password for %s."),
+                               user) < 0) {
                                pam_syslog(pamh, LOG_CRIT,
                                         "password - out of memory");
                                return PAM_BUF_ERR;
                        }
-                       (void) strcpy(Announce, greeting);
-                       (void) strcpy(Announce + sizeof(greeting) - 1, user);
-#undef greeting
 
                        lctrl = ctrl;
                        set(UNIX__OLD_PASSWD, lctrl);