summaryrefslogtreecommitdiff
path: root/modules/pam_stress
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2006-12-18 14:51:41 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2006-12-18 14:51:41 +0000
commit52fc68099239cfff5802b0d0b1d4a5c8758f4b74 (patch)
tree5a3974bf80091d9d9e48784cb273645e5beaf856 /modules/pam_stress
parentca332123df433462ac5574840cc282bea901e140 (diff)
Relevant BUGIDs:
Purpose of commit: cleanup Commit summary: --------------- 2006-12-18 Thorsten Kukuk <kukuk@thkukuk.de> * modules/pam_stress/pam_stress.c (pam_sm_chauthtok): Fix localisation of message printed to user. * po/de.po: Adjust translation.
Diffstat (limited to 'modules/pam_stress')
-rw-r--r--modules/pam_stress/pam_stress.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/modules/pam_stress/pam_stress.c b/modules/pam_stress/pam_stress.c
index c8b7ddf3..c254868f 100644
--- a/modules/pam_stress/pam_stress.c
+++ b/modules/pam_stress/pam_stress.c
@@ -1,6 +1,5 @@
-/* pam_stress module */
-
-/* $Id$
+/*
+ * pam_stress module
*
* created by Andrew Morgan <morgan@linux.kernel.org> 1996/3/12
*/
@@ -474,12 +473,12 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
}
pmsg[0] = &msg[0];
msg[0].msg_style = PAM_TEXT_INFO;
-#define _LOCAL_STRESS_COMMENT _("Changing STRESS password for ")
- txt = (char *) malloc(strlen(_LOCAL_STRESS_COMMENT)
- +strlen(username)+1);
- strcpy(txt, _LOCAL_STRESS_COMMENT);
-#undef _LOCAL_STRESS_COMMENT
- strcat(txt, username);
+ if (asprintf(&txt, _("Changing STRESS password for %s."),
+ (const char *)username) < 0) {
+ pam_syslog(pamh, LOG_CRIT, "out of memory");
+ return PAM_BUF_ERR;
+ }
+
msg[0].msg = txt;
i = 1;
} else {