Windows Installer work, fix 100% CPU bug in EthernetTap on Windows, Windows lockDownFile() implementation that uses 'cacls' utility.

This commit is contained in:
Adam Ierymenko 2014-01-26 10:21:43 -08:00
parent f19d1e253a
commit 22efa1ab53
5 changed files with 119 additions and 17 deletions

View file

@ -419,12 +419,16 @@ Node::ReasonForTermination Node::run()
}
Utils::lockDownFile(identitySecretPath.c_str(),false);
// Make sure networks.d exists
// Make sure networks.d exists and is secure
{
std::string networksDotD(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d");
#ifdef __WINDOWS__
CreateDirectoryA((_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d").c_str(),NULL);
CreateDirectoryA(networksDotD.c_str(),NULL);
#else
mkdir((_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d").c_str(),0700);
mkdir(networksDotD.c_str(),0700);
#endif
Utils::lockDownFile(networksDotD.c_str(),true);
}
// Load or generate config authentication secret
std::string configAuthTokenPath(_r->homePath + ZT_PATH_SEPARATOR_S + "authtoken.secret");