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:
11
src/exec.c
11
src/exec.c
@@ -47,6 +47,9 @@
|
|||||||
#if TIME_WITH_SYS_TIME
|
#if TIME_WITH_SYS_TIME
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_SETLOCALE
|
||||||
|
# include <locale.h>
|
||||||
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <signal.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))
|
if (ISSET(details->flags, CD_SET_TIMEOUT))
|
||||||
alarm(details->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
|
* In the event loop we pass input from user tty to master
|
||||||
* and pass output from master to stdout and IO plugin.
|
* and pass output from master to stdout and IO plugin.
|
||||||
|
Reference in New Issue
Block a user