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:
parent
a3e4db1244
commit
e11e4efb8f
11
src/exec.c
11
src/exec.c
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user