Switch to the C locale before sending messages to syslog. The messages
sent by shadow were not translated, but error messages from PAM returned by pam_strerror() were translated in the users's locale.
This commit is contained in:
@@ -142,13 +142,15 @@ char *strchr (), *strrchr (), *strtok ();
|
||||
syslogd should log the current system time for each event, and not
|
||||
trust the formatted time received from the unix domain (or worse,
|
||||
UDP) socket. -MM */
|
||||
/* Avoid translated PAM error messages: Set LC_ALL to "C".
|
||||
* --Nekral */
|
||||
#define SYSLOG(x) \
|
||||
do { \
|
||||
char *saved_locale = setlocale(LC_ALL, NULL); \
|
||||
if (saved_locale) \
|
||||
saved_locale = strdup(saved_locale); \
|
||||
if (saved_locale) \
|
||||
setlocale(LC_TIME, "C"); \
|
||||
setlocale(LC_ALL, "C"); \
|
||||
syslog x ; \
|
||||
if (saved_locale) { \
|
||||
setlocale(LC_ALL, saved_locale); \
|
||||
|
Reference in New Issue
Block a user