Module: check_mk
Branch: master
Commit: 8544bdbfff6277b20d56e5ab1fece74e1fd30965
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8544bdbfff6277…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jun 3 14:18:46 2013 +0200
windows agent not longer executes directories
---
ChangeLog | 1 +
agents/windows/check_mk_agent.cc | 6 ++++++
agents/windows/check_mk_agent.exe | Bin 112640 -> 112640 bytes
agents/windows/crash.exe | Bin 20024 -> 20024 bytes
agents/windows/install_agent.exe | Bin 131798 -> 131811 bytes
agents/windows/nowin.exe | Bin 22511 -> 22511 bytes
6 files changed, 7 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index a56c28d..1daa238 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@
you queried multiple host systems via vCenter
* cached checks: no longer output cached data if the age of the
cache file is twice the maximum cache age
+ * windows agent: no longer tries to execute directories
Notifications:
* Flexible Notification can now filter service levels
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index a69b596..4b2249c 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -2087,6 +2087,12 @@ void launch_program(SOCKET &out, char *dirname, char *name,
bool is_plugin){
char path[512];
snprintf(path, sizeof(path), "%s\\%s", dirname, name);
+ // If the path in question is a directory -> return
+ DWORD dwAttr = GetFileAttributes(path);
+ if(dwAttr != 0xffffffff && (dwAttr & FILE_ATTRIBUTE_DIRECTORY)) {
+ return;
+ }
+
crash_log("Running program %s", path);
char newpath[512];
char *command = add_interpreter(path, newpath);
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index eb5abf3..b3f2665 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe
differ
diff --git a/agents/windows/crash.exe b/agents/windows/crash.exe
index 65b86d5..eb151ae 100755
Binary files a/agents/windows/crash.exe and b/agents/windows/crash.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index 5cad004..2f33014 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe
differ
diff --git a/agents/windows/nowin.exe b/agents/windows/nowin.exe
index 63bdf3c..fbb9600 100755
Binary files a/agents/windows/nowin.exe and b/agents/windows/nowin.exe differ