From 4d58adb83fc9184bbda34a280763bbf97b44dfb7 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 16 Jun 2021 01:11:36 +0200 Subject: [PATCH] Prevent against environment modifications Should not be necessary here, but better safe than sorry. --- src/common/logging/common.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/logging/common.cpp b/src/common/logging/common.cpp index cd0a86b0..da2c7302 100644 --- a/src/common/logging/common.cpp +++ b/src/common/logging/common.cpp @@ -25,6 +25,8 @@ #include #include +namespace bp = boost::process; + /** * The environment variable indicating whether to log to a file. Will log to * STDERR if not specified. @@ -49,7 +51,7 @@ Logger::Logger(std::shared_ptr stream, prefix_timestamp(prefix_timestamp) {} Logger Logger::create_from_environment(std::string prefix) { - auto env = boost::this_process::environment(); + bp::environment env = boost::this_process::environment(); std::string file_path = env[logging_file_environment_variable].to_string(); std::string verbosity = env[logging_verbosity_environment_variable].to_string(); @@ -81,7 +83,7 @@ Logger Logger::create_from_environment(std::string prefix) { } Logger Logger::create_wine_stderr() { - auto env = boost::this_process::environment(); + bp::environment env = boost::this_process::environment(); std::string verbosity = env[logging_verbosity_environment_variable].to_string();