]> granicus.if.org Git - shadow/commitdiff
Switch to the C locale before sending messages to syslog. The messages
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 3 Feb 2008 17:53:21 +0000 (17:53 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 3 Feb 2008 17:53:21 +0000 (17:53 +0000)
sent by shadow were not translated, but error messages from PAM returned
by pam_strerror() were translated in the users's locale.

ChangeLog
NEWS
lib/defines.h

index d99a732a61488cd6b5e75ecacbb5b549ee235071..b30ddf335c59f6eaff2df75e63207f9bf6c72440 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-02-03  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * NEWS, lib/defines.h: 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.
+
 2008-02-03  Nicolas François  <nicolas.francois@centraliens.net>
 
        * NEWS: newusers will behave more like useradd.
diff --git a/NEWS b/NEWS
index 93887c13ce978447f117a42d39b67d64ccbc7322..0d853b998454d7f8cf5779674962ac1229739ed1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,9 @@ shadow-4.1.0 -> shadow-4.1.1                                            UNRELEASED
     generated in the same second.
 - packaging
   * Do not install the shadow library per default.
+- general
+  * Do not translate the messages sent to syslog. This avoids logging
+    PAM error messages in the users's locale.
 - chage
   * Fix bug which forbid to set the aging information of an account with a
     passwd entry, but no shadow entry.
index e46b80fcf6da86da881312dfdb096dfe90bdf0e6..a3ab5aaf910fc77d96e03292639503a1fcced5f6 100644 (file)
@@ -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);                \