2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-29 05:17:54 +00:00

Do I/O logging in the C locale so the floating point numbers in the

timing file are not locale-dependent.
This commit is contained in:
Todd C. Miller 2010-07-27 09:45:20 -04:00
parent a3e4db1244
commit e11e4efb8f

View File

@ -47,6 +47,9 @@
#if TIME_WITH_SYS_TIME
# include <time.h>
#endif
#ifdef HAVE_SETLOCALE
# include <locale.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
@ -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.