From 69b759b592968a88a76dc19269eb0027a43765b8 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 27 Jul 2010 09:41:13 -0400 Subject: [PATCH] Do I/O logging in the C locale so the floating point numbers in the timing file are not locale-dependent. --HG-- branch : 1.7 --- exec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/exec.c b/exec.c index afef44781..93316a001 100644 --- a/exec.c +++ b/exec.c @@ -52,6 +52,9 @@ #if TIME_WITH_SYS_TIME # include #endif +#ifdef HAVE_SETLOCALE +# include +#endif #include #include #include @@ -228,6 +231,14 @@ sudo_execve(path, argv, envp, uid, cstat, dowait, bgmode) child = fork_cmnd(path, argv, envp, sv, rbac_enabled); close(sv[1]); +#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. -- 2.40.0