Take a note why the explicit configDir variable is needed on Windows

This commit is contained in:
Michael Friedrich 2018-08-07 18:33:59 +02:00
parent 857c812227
commit a2a1f5c8d2
2 changed files with 5 additions and 1 deletions

View File

@ -359,7 +359,10 @@ static int Main()
GetUserName(username, &usernameLen);
std::ifstream userFile;
userFile.open(Application::GetConst("ConfigDir") + "/user");
/* The implicit string assignment is needed for Windows builds. */
String configDir = Application::GetConst("ConfigDir");
userFile.open(configDir + "/user");
if (userFile && command && !Application::IsProcessElevated()) {
std::string userLine;

View File

@ -205,6 +205,7 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
if (vm.count("config") > 0)
configs = vm["config"].as<std::vector<std::string> >();
else if (!vm.count("no-config")) {
/* The implicit string assignment is needed for Windows builds. */
String configDir = Application::GetConst("ConfigDir");
configs.push_back(configDir + "/icinga2.conf");
}