Module: check_mk
Branch: master
Commit: 880b858af5b94a40bb46a997dc5f3167a44cf641
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=880b858af5b94a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jun 23 11:11:08 2015 +0200
#2311: windows agent: now replaces BOM (byte order marks) from local and plugin scripts
---
.werks/2311 | 16 ++++++++++++++++
ChangeLog | 1 +
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 301568 -> 302080 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 301568 -> 302080 bytes
agents/windows/check_mk_agent.cc | 17 +++++++++++++++++
agents/windows/check_mk_agent.exe | Bin 183808 -> 183808 bytes
agents/windows/check_mk_agent.msi | Bin 734208 -> 734720 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 183808 -> 183808 bytes
agents/windows/crash.exe | Bin 20024 -> 20024 bytes
agents/windows/install_agent-64.exe | Bin 178942 -> 179004 bytes
agents/windows/install_agent.exe | Bin 159862 -> 159945 bytes
agents/windows/nowin.exe | Bin 22511 -> 22511 bytes
13 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/.werks/2311 b/.werks/2311
new file mode 100644
index 0000000..b65adff
--- /dev/null
+++ b/.werks/2311
@@ -0,0 +1,16 @@
+Title: windows agent: now replaces BOM (byte order marks) from local and plugin scripts
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i2
+Date: 1435049944
+
+Some windows plugins recklessly reported byte order marks
+at the beginning of their output, which lead problems when
+the data was evaluated.
+
+With this change byte order marks will be replaced by empty lines.
+Empty lines in the agent output are ignored, so there won't be any
+side effects.
diff --git a/ChangeLog b/ChangeLog
index 5eda13c..fa8c31d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,7 @@
* 2221 FIX: cisco_temperature: Fixed order of device levels for some devices...
* 2329 FIX: windows_intel_bonding: Fix exception in case of no existing bonding
device
* 2355 FIX: docsis_channels_upstream: Fix graph definitions
+ * 2311 FIX: windows agent: now replaces BOM (byte order marks) from local and plugin
scripts...
Multisite:
* 2260 Improved load time of Check_MK GUI...
diff --git a/agents/windows/build_version b/agents/windows/build_version
index f07e286..dc37bbd 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-175
+184
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index ede8c61..b3ec213 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 ecd9866..a502431 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 5c15956..7920a85 100644
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -3079,6 +3079,23 @@ void output_external_programs(SOCKET &out, script_type type)
cont->buffer = NULL;
}
+ // Replace BOM for UTF-16 LE and UTF-8 with newlines
+ if ( (strlen(cont->buffer_work)) >= 2 &&
+ ((unsigned char)cont->buffer_work[0] == 0xFF && (unsigned
char)cont->buffer_work[1] == 0xFE) )
+ {
+ cont->buffer_work[0] = '\n';
+ cont->buffer_work[1] = '\n';
+ }
+ else if ( strlen(cont->buffer_work) >= 3 &&
+ (unsigned char)cont->buffer_work[0] == 0xEF &&
+ (unsigned char)cont->buffer_work[1] == 0xBB &&
+ (unsigned char)cont->buffer_work[1] == 0xBF )
+ {
+ cont->buffer_work[0] = '\n';
+ cont->buffer_work[1] = '\n';
+ cont->buffer_work[2] = '\n';
+ }
+
if (cont->max_age == 0)
cont->buffer = cont->buffer_work;
else
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 27f1f02..1434132 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 faccffc..e25938e 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 e2b1594..012d67e 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/crash.exe b/agents/windows/crash.exe
index 7d93369..a58557b 100755
Binary files a/agents/windows/crash.exe and b/agents/windows/crash.exe differ
diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe
index cf1d178..6afb7bf 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 fbc2fe1..81ac4f2 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 f7242cb..4ef5457 100755
Binary files a/agents/windows/nowin.exe and b/agents/windows/nowin.exe differ