]> granicus.if.org Git - sudo/commitdiff
Use sudoers_initlocale() in main() startup, not sudoers_setlocal()
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 27 Dec 2013 13:50:06 +0000 (06:50 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 27 Dec 2013 13:50:06 +0000 (06:50 -0700)
as the latter assumes we are already in the user's locale which may
not be the case.  For sudoreplay, we can just use setlocale()
directly as there is no sudoers locale.

plugins/sudoers/sudoreplay.c
plugins/sudoers/testsudoers.c
plugins/sudoers/visudo.c

index 3b28633c03fa9342978b67fc606b49cce366e931..e7e047c4667ba06ffb9830ca3efcb7da72fc0d95 100644 (file)
@@ -242,7 +242,7 @@ main(int argc, char *argv[])
 #endif
 
     initprogname(argc > 0 ? argv[0] : "sudoreplay");
-    sudoers_setlocale(SUDOERS_LOCALE_USER, NULL);
+    setlocale(LC_ALL, NULL);
     decimal = localeconv()->decimal_point;
     bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have sudoreplay domain */
     textdomain("sudoers");
index 66ded058e793dd1d9ed393560fa416e4a907e4ae..7105b093a3e466d1d99ee5fed863aba73e971e0a 100644 (file)
@@ -134,7 +134,7 @@ main(int argc, char *argv[])
 
     initprogname(argc > 0 ? argv[0] : "testsudoers");
 
-    sudoers_setlocale(SUDOERS_LOCALE_USER, NULL);
+    sudoers_initlocale(setlocale(LC_ALL, NULL), def_sudoers_locale);
     bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have own domain */
     textdomain("sudoers");
 
index 0dcd6033701e41f340071434e4ce6c2162f9a534..f24da1de10833bb23e7e1fca697e545c11422359 100644 (file)
@@ -159,7 +159,7 @@ main(int argc, char *argv[])
 #endif
 
     initprogname(argc > 0 ? argv[0] : "visudo");
-    sudoers_setlocale(SUDOERS_LOCALE_USER, NULL);
+    sudoers_initlocale(setlocale(LC_ALL, NULL), def_sudoers_locale);
     bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have visudo domain */
     textdomain("sudoers");