summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2014-08-08 14:57:13 -0700
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2014-08-08 14:57:13 -0700
commitfe3ad5e2cc27b6b7e9bf8f78e6e681bd10315143 (patch)
tree815b6d4750fc9162841aeeae121be5e17bd0e172 /node
parent502ea66f151b0bef05c5a4183e955c2d358a837a (diff)
downloadinfinitytier-fe3ad5e2cc27b6b7e9bf8f78e6e681bd10315143.tar.gz
infinitytier-fe3ad5e2cc27b6b7e9bf8f78e6e681bd10315143.zip
Fix a Windows bug in refactored tap code, and always make sure we have a firewall exception rule on startup.
Diffstat (limited to 'node')
-rw-r--r--node/Dictionary.cpp2
-rw-r--r--node/Utils.cpp14
2 files changed, 7 insertions, 9 deletions
diff --git a/node/Dictionary.cpp b/node/Dictionary.cpp
index e050143b..50440e5b 100644
--- a/node/Dictionary.cpp
+++ b/node/Dictionary.cpp
@@ -110,7 +110,7 @@ bool Dictionary::verify(const Identity &id) const
if (sig == end())
return false;
std::string sigbin(Utils::unhex(sig->second));
- return id.verify(buf.data(),(unsigned int)buf.length(),sigbin.data(),sigbin.length());
+ return id.verify(buf.data(),(unsigned int)buf.length(),sigbin.data(),(unsigned int)sigbin.length());
} catch ( ... ) {
return false;
}
diff --git a/node/Utils.cpp b/node/Utils.cpp
index 86106386..ba7fb057 100644
--- a/node/Utils.cpp
+++ b/node/Utils.cpp
@@ -260,22 +260,20 @@ void Utils::lockDownFile(const char *path,bool isDir)
#ifdef __WINDOWS__
{
STARTUPINFOA startupInfo;
- startupInfo.cb = sizeof(startupInfo);
PROCESS_INFORMATION processInfo;
+
+ startupInfo.cb = sizeof(startupInfo);
memset(&startupInfo,0,sizeof(STARTUPINFOA));
memset(&processInfo,0,sizeof(PROCESS_INFORMATION));
- /*
- if (CreateProcessA(NULL,(LPSTR)(std::string("C:\\Windows\\System32\\cacls.exe \"") + path + "\" /E /R Users").c_str(),NULL,NULL,FALSE,0,NULL,NULL,&startupInfo,&processInfo)) {
- WaitForSingleObject(processInfo.hProcess,INFINITE);
- CloseHandle(processInfo.hProcess);
- CloseHandle(processInfo.hThread);
- }
- */
if (CreateProcessA(NULL,(LPSTR)(std::string("C:\\Windows\\System32\\icacls.exe \"") + path + "\" /inheritance:d /Q").c_str(),NULL,NULL,FALSE,0,NULL,NULL,&startupInfo,&processInfo)) {
WaitForSingleObject(processInfo.hProcess,INFINITE);
CloseHandle(processInfo.hProcess);
CloseHandle(processInfo.hThread);
}
+
+ startupInfo.cb = sizeof(startupInfo);
+ memset(&startupInfo,0,sizeof(STARTUPINFOA));
+ memset(&processInfo,0,sizeof(PROCESS_INFORMATION));
if (CreateProcessA(NULL,(LPSTR)(std::string("C:\\Windows\\System32\\icacls.exe \"") + path + "\" /remove *S-1-5-32-545 /Q").c_str(),NULL,NULL,FALSE,0,NULL,NULL,&startupInfo,&processInfo)) {
WaitForSingleObject(processInfo.hProcess,INFINITE);
CloseHandle(processInfo.hProcess);