2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Use sudoers_initlocale() in main() startup, not sudoers_setlocal()

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.
This commit is contained in:
Todd C. Miller
2013-12-27 06:50:06 -07:00
parent 4d80e7cea4
commit 91db1efe91
3 changed files with 3 additions and 3 deletions

View 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");

View 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");

View 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");