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:
@@ -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");
|
||||
|
@@ -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");
|
||||
|
||||
|
@@ -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");
|
||||
|
||||
|
Reference in New Issue
Block a user