From e11e4efb8f911d0a2581961b1cc9ce511cea9adf Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 27 Jul 2010 09:45:20 -0400 Subject: [PATCH] Do I/O logging in the C locale so the floating point numbers in the timing file are not locale-dependent. --- src/exec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/exec.c b/src/exec.c index 61ec4fb8b..76875e44b 100644 --- a/src/exec.c +++ b/src/exec.c @@ -47,6 +47,9 @@ #if TIME_WITH_SYS_TIME # include #endif +#ifdef HAVE_SETLOCALE +# include +#endif #include #include #include @@ -198,6 +201,14 @@ sudo_execve(struct command_details *details, char *argv[], char *envp[], 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 * and pass output from master to stdout and IO plugin.