struct sudo_conf_table *cur;
struct stat sb;
FILE *fp;
- char *cp;
-#ifdef HAVE_SETLOCALE
- char *prev_locale = estrdup(setlocale(LC_ALL, NULL));
+ char *cp, *prev_locale = estrdup(setlocale(LC_ALL, NULL));
/* Parse sudo.conf in the "C" locale. */
if (prev_locale[0] != 'C' || prev_locale[1] != '\0')
setlocale(LC_ALL, "C");
-#endif
switch (sudo_secure_file(_PATH_SUDO_CONF, ROOT_UID, -1, &sb)) {
case SUDO_PATH_SECURE:
}
fclose(fp);
done:
-#ifdef HAVE_SETLOCALE
/* Restore locale if needed. */
if (prev_locale[0] != 'C' || prev_locale[1] != '\0')
setlocale(LC_ALL, prev_locale);
efree(prev_locale);
-#endif
return;
}
/* Define to 1 if you have the `setkeycreatecon' function. */
#undef HAVE_SETKEYCREATECON
-/* Define to 1 if you have the `setlocale' function. */
-#undef HAVE_SETLOCALE
-
/* Define to 1 if you have the `setresuid' function. */
#undef HAVE_SETRESUID
LIBS=$ac_save_LIBS
for ac_func in glob strrchr sysconf tzset strftime setenv \
- regcomp setlocale nl_langinfo mbr_check_membership \
+ regcomp nl_langinfo mbr_check_membership \
setrlimit64
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
dnl
AC_FUNC_GETGROUPS
AC_CHECK_FUNCS(glob strrchr sysconf tzset strftime setenv \
- regcomp setlocale nl_langinfo mbr_check_membership \
+ regcomp nl_langinfo mbr_check_membership \
setrlimit64)
AC_REPLACE_FUNCS(getgrouplist)
AC_CHECK_FUNCS(getline, [], [
* Solaris locale.h includes libintl.h which causes problems when we
* redefine the gettext functions. We include it first to avoid this.
*/
-#if defined(HAVE_SETLOCALE)
-# include <locale.h>
-#endif
+#include <locale.h>
#ifdef HAVE_LIBINTL_H
* If prevlocale is non-NULL it will be filled in with the
* old SUDOERS_LOCALE_* value.
*/
-#ifdef HAVE_SETLOCALE
bool
sudoers_setlocale(int newlocale, int *prevlocale)
{
}
return res ? true : false;
}
-#else
-bool
-sudoers_setlocale(int newlocale, int *prevlocale)
-{
- switch (newlocale) {
- case SUDOERS_LOCALE_USER:
- case SUDOERS_LOCALE_SUDOERS:
- if (prevlocale)
- *prevlocale = current_locale;
- current_locale = newlocale;
- return true;
- default:
- return false;
- }
-}
-#endif /* HAVE_SETLOCALE */
(void) tzset(); /* set the timezone if applicable */
#endif /* HAVE_TZSET */
-#ifdef HAVE_SETLOCALE
user_locale = estrdup(setlocale(LC_ALL, NULL));
-#endif
for (ep = envp; *ep; ep++) {
/* XXX - don't fill in if empty string */
{
int ch, idx, plen, exitcode = 0, rows = 0, cols = 0;
bool interactive = false, listonly = false, need_nlcr = false;
- const char *id, *user = NULL, *pattern = NULL, *tty = NULL, *decimal = ".";
+ const char *decimal, *id, *user = NULL, *pattern = NULL, *tty = NULL;
char path[PATH_MAX], buf[LINE_MAX], *cp, *ep;
double seconds, to_wait, speed = 1.0, max_wait = 0;
sigaction_t sa;
setprogname(argc > 0 ? argv[0] : "sudoreplay");
#endif
-#ifdef HAVE_SETLOCALE
setlocale(LC_ALL, "");
decimal = localeconv()->decimal_point;
-#endif
bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have sudoreplay domain */
textdomain("sudoers");
setprogname(argc > 0 ? argv[0] : "testsudoers");
#endif
-#ifdef HAVE_SETLOCALE
setlocale(LC_ALL, "");
-#endif
bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have own domain */
textdomain("sudoers");
setprogname(argc > 0 ? argv[0] : "visudo");
#endif
-#ifdef HAVE_SETLOCALE
setlocale(LC_ALL, "");
-#endif
bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have visudo domain */
textdomain("sudoers");
_warning(int use_errno, const char *fmt, va_list ap)
{
int serrno = errno;
-#ifdef HAVE_SETLOCALE
char *prev_locale = estrdup(setlocale(LC_ALL, NULL));
/* Set locale to user's if different. */
if (*prev_locale != '\0')
setlocale(LC_ALL, "");
-#endif
fputs(getprogname(), stderr);
if (fmt != NULL) {
}
putc('\n', stderr);
-#ifdef HAVE_SETLOCALE
/* Restore locale if needed. */
if (*prev_locale != '\0')
setlocale(LC_ALL, prev_locale);
efree(prev_locale);
-#endif
}
if (ISSET(details->flags, CD_SET_TIMEOUT))
alarm(details->timeout);
-#ifdef HAVE_SETLOCALE
/*
* I/O logging must be in the C locale for floating point numbers
* to be logged consistently.
*/
setlocale(LC_ALL, "C");
-#endif
/*
* In the event loop we pass input from user tty to master
int noexec = 0;
debug_decl(main, SUDO_DEBUG_MAIN)
-#ifdef HAVE_SETLOCALE
setlocale(LC_ALL, "");
-#endif
bindtextdomain(PACKAGE_NAME, LOCALEDIR);
textdomain(PACKAGE_NAME);
os_init(argc, argv, envp);
-#ifdef HAVE_SETLOCALE
setlocale(LC_ALL, "");
-#endif
bindtextdomain(PACKAGE_NAME, LOCALEDIR);
textdomain(PACKAGE_NAME);