]> granicus.if.org Git - sudo/commitdiff
Set locale to "C" if locales are supported, just to be safe.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 10 Feb 2005 03:24:00 +0000 (03:24 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 10 Feb 2005 03:24:00 +0000 (03:24 +0000)
config.h.in
configure
configure.in
sudo.c

index 05147ee43b42b679e3282fc628380950b82f1905..670d5f3d2603d1aae86ce5b0bc6bf5a2fb344c05 100644 (file)
 /* Define to 1 if you use SecurID for authentication. */
 #undef HAVE_SECURID
 
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
 /* Define to 1 if you have the `setproctitle' function. */
 #undef HAVE_SETPROCTITLE
 
index 88ac9075d711cb7f8f687966c756c2f219de3b08..668b6e3c32d10d680ab47382b451ce6d0501c2e8 100755 (executable)
--- a/configure
+++ b/configure
@@ -25887,8 +25887,10 @@ esac
 
 
 
+
 for ac_func in strchr strrchr memchr memcpy memmove memset sysconf tzset \
-              strftime setrlimit initgroups getgroups fstat gettimeofday
+              strftime setrlimit initgroups getgroups fstat gettimeofday \
+              setlocale
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
index 378f534c21b34566a557f13146b55b0269d5972b..c5042f5dd8a3eb6f7a0bd449f427b3d9e16a6a3c 100644 (file)
@@ -1714,7 +1714,8 @@ dnl
 dnl Function checks
 dnl
 AC_CHECK_FUNCS(strchr strrchr memchr memcpy memmove memset sysconf tzset \
-              strftime setrlimit initgroups getgroups fstat gettimeofday)
+              strftime setrlimit initgroups getgroups fstat gettimeofday \
+              setlocale)
 if test -z "$SKIP_SETRESUID"; then
     AC_CHECK_FUNCS(setresuid, [SKIP_SETREUID=yes])
 fi
diff --git a/sudo.c b/sudo.c
index ea50d9baf4fc7d7baecbca714fc4ef9f3fe84a7e..eba4c1673dac52d2b735ae6d75dda9c6c979fb42 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -67,6 +67,9 @@
 #if TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
+#ifdef HAVE_SETLOCALE
+# include <locale.h>
+#endif
 #include <netinet/in.h>
 #include <netdb.h>
 #if defined(HAVE_GETPRPWNAM) && defined(HAVE_SET_AUTH_PARAMETERS)
@@ -156,6 +159,10 @@ main(argc, argv, envp)
 #endif
     extern char **environ;
 
+#ifdef HAVE_SETLOCALE
+    setlocale(LC_ALL, "C");
+#endif
+
     Argv = argv;
     if ((Argc = argc) < 1)
        usage(1);