Module: check_mk
Branch: master
Commit: 086b8a72eecc30e5473e867c62109467351f5e3d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=086b8a72eecc30…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Mon Oct 19 17:09:31 2015 +0200
windows agent: fixed a bug in logwatch causing wrong parameters (level/context) to be
applied for eventlogs
---
agents/windows/.gitignore | 1 +
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 830464 -> 830464 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 830464 -> 830464 bytes
agents/windows/check_mk_agent.cc | 12 ------------
agents/windows/check_mk_agent.exe | Bin 748032 -> 748032 bytes
agents/windows/check_mk_agent.msi | Bin 1836544 -> 1836544 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 748032 -> 748032 bytes
agents/windows/install_agent-64.exe | Bin 383233 -> 383077 bytes
agents/windows/install_agent.exe | Bin 374175 -> 374059 bytes
agents/windows/stringutil.cc | 19 +++++++++++++++++++
agents/windows/stringutil.h | 10 +++++++++-
12 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/agents/windows/.gitignore b/agents/windows/.gitignore
index f1086c4..150a703 100644
--- a/agents/windows/.gitignore
+++ b/agents/windows/.gitignore
@@ -6,3 +6,4 @@ obj64
success.log
*.res
*.rc
+tests
diff --git a/agents/windows/build_version b/agents/windows/build_version
index 6962904..82d4520 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-569
+589
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index adf3fe7..659c3e0 100755
Binary files a/agents/windows/check_mk_agent-64.exe and
b/agents/windows/check_mk_agent-64.exe differ
diff --git a/agents/windows/check_mk_agent-64.unversioned.exe
b/agents/windows/check_mk_agent-64.unversioned.exe
index 05d2887..f8e99f0 100755
Binary files a/agents/windows/check_mk_agent-64.unversioned.exe and
b/agents/windows/check_mk_agent-64.unversioned.exe differ
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index 3e9ac26..e6f920e 100644
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -308,18 +308,6 @@ void debug_script_container( script_container* container )
}
-bool ci_compare_pred(unsigned char lhs, unsigned char rhs)
-{
- return std::tolower(lhs) == std::tolower(rhs);
-}
-
-// case insensitive compare
-bool ci_equal(const std::string &lhs, const std::string &rhs)
-{
- return std::lexicographical_compare(lhs.begin(), lhs.end(),
- rhs.begin(), rhs.end(), ci_compare_pred);
-}
-
template <typename FuncT> FuncT dynamic_func(LPCWSTR dllName, LPCSTR funcName) {
HMODULE mod = LoadLibraryW(dllName);
if (mod != NULL) {
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 60e5b8d..31f8a5f 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe
differ
diff --git a/agents/windows/check_mk_agent.msi b/agents/windows/check_mk_agent.msi
index 748ab3d..4e5eb8a 100755
Binary files a/agents/windows/check_mk_agent.msi and b/agents/windows/check_mk_agent.msi
differ
diff --git a/agents/windows/check_mk_agent.unversioned.exe
b/agents/windows/check_mk_agent.unversioned.exe
index 7e4ab5f..19f5039 100755
Binary files a/agents/windows/check_mk_agent.unversioned.exe and
b/agents/windows/check_mk_agent.unversioned.exe differ
diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe
index 7076414..79f27f4 100755
Binary files a/agents/windows/install_agent-64.exe and
b/agents/windows/install_agent-64.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index 402b1c3..03ff0e5 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe
differ
diff --git a/agents/windows/stringutil.cc b/agents/windows/stringutil.cc
index 04a3908..f6b0eef 100644
--- a/agents/windows/stringutil.cc
+++ b/agents/windows/stringutil.cc
@@ -2,7 +2,11 @@
#include <cstring>
#include <cctype>
#include <cstdio>
+#include <cstdlib>
+
+#ifdef _WIN32
#include <windows.h>
+#endif
char *lstrip(char *s)
@@ -146,6 +150,19 @@ int parse_boolean(char *value)
return -1;
}
+
+bool ci_compare_pred(unsigned char lhs, unsigned char rhs)
+{
+ return std::tolower(lhs) == std::tolower(rhs);
+}
+
+
+bool ci_equal(const std::string &lhs, const std::string &rhs)
+{
+ return std::equal(lhs.begin(), lhs.end(), rhs.begin(), ci_compare_pred);
+}
+
+
bool globmatch(const char *pattern, const char *astring)
{
const char *p = pattern;
@@ -193,6 +210,7 @@ bool globmatch(const char *pattern, const char *astring)
}
+#ifdef _WIN32
std::string get_win_error_as_string(DWORD error_id)
{
//Get the error message, if any.
@@ -211,4 +229,5 @@ std::string get_win_error_as_string(DWORD error_id)
return message;
}
+#endif // WIN32
diff --git a/agents/windows/stringutil.h b/agents/windows/stringutil.h
index 2aaf1b6..b000eb0 100644
--- a/agents/windows/stringutil.h
+++ b/agents/windows/stringutil.h
@@ -32,7 +32,11 @@
// umm, this is a C header, not actually part of C++ until C++11. This may be a problem
in older
// MSVCs
#include <stdint.h>
+
+#ifdef _WIN32
#include <windows.h>
+#endif
+
char *lstrip(char *s);
@@ -51,12 +55,16 @@ void lowercase(char *s);
int parse_boolean(char *value);
+// case insensitive compare
+bool ci_equal(const std::string &lhs, const std::string &rhs);
+
// Do a simple pattern matching with the jokers * and ?.
// This is case insensitive (windows-like).
bool globmatch(const char *pattern, const char *astring);
+#ifdef _WIN32
std::string get_win_error_as_string(DWORD error_id = ::GetLastError());
-
+#endif
// to_string and to_wstring supplied in C++11 but not before
#if _cplusplus < 201103L