Module: check_mk
Branch: master
Commit: 4ca9673085c03c665488b07cfe248f53ba59842b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4ca9673085c03c…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Mar 8 12:59:32 2017 +0100
4456 FIX windows agent: fixed broken agent encryption when section data exceeded 16kB
Change-Id: Ia28fe09086cc3a69fd5c60f3c4f5c8e32f04b59e
---
.werks/4456 | 11 +++++++++++
agents/windows/OutputProxy.cc | 11 ++++++++---
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 1339392 -> 1339392 bytes
agents/windows/check_mk_agent-64.unstripped.exe | Bin 15810554 -> 15811578 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 1339392 -> 1339392 bytes
agents/windows/check_mk_agent.exe | Bin 1316864 -> 1316864 bytes
agents/windows/check_mk_agent.msi | Bin 2926080 -> 2926080 bytes
agents/windows/check_mk_agent.unstripped.exe | Bin 13671970 -> 13671970 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 1316864 -> 1316864 bytes
agents/windows/crash.exe | Bin 101624 -> 101624 bytes
agents/windows/install_agent-64.exe | Bin 591554 -> 591624 bytes
agents/windows/install_agent.exe | Bin 589009 -> 589000 bytes
agents/windows/nowin.exe | Bin 103760 -> 103760 bytes
14 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/.werks/4456 b/.werks/4456
new file mode 100644
index 0000000..3c0f6af
--- /dev/null
+++ b/.werks/4456
@@ -0,0 +1,11 @@
+Title: windows agent: fixed broken agent encryption when section data exceeded 16kB
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1488973927
+
+The agent encryption only worked if the sections had less than 16kB (~300 lines standard
output).
diff --git a/agents/windows/OutputProxy.cc b/agents/windows/OutputProxy.cc
index 747a660..3169c31 100644
--- a/agents/windows/OutputProxy.cc
+++ b/agents/windows/OutputProxy.cc
@@ -76,11 +76,16 @@ void BufferedSocketProxy::output(const char *format, ...) {
_length += written_len;
}
+
void BufferedSocketProxy::writeBinary(const char *buffer, size_t size) {
- if (_buffer.size() - _length >= size) {
- memcpy(&_buffer[0] + _length, buffer, size);
- _length += size;
+ size_t target_size = _length + size + 1;
+ if (_buffer.size() < target_size) {
+ size_t new_size = _buffer.size() * 2;
+ _buffer.resize(new_size);
}
+
+ memcpy(&_buffer[0] + _length, buffer, size);
+ _length += size;
}
void BufferedSocketProxy::flush(bool) {
diff --git a/agents/windows/build_version b/agents/windows/build_version
index fe8591e..4cbaed0 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-2639
+2651
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index 60b8d9a..319b525 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.unstripped.exe
b/agents/windows/check_mk_agent-64.unstripped.exe
index 490e6a4..b90631f 100755
Binary files a/agents/windows/check_mk_agent-64.unstripped.exe and
b/agents/windows/check_mk_agent-64.unstripped.exe differ
diff --git a/agents/windows/check_mk_agent-64.unversioned.exe
b/agents/windows/check_mk_agent-64.unversioned.exe
index 216c63c..e8cadd7 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.exe b/agents/windows/check_mk_agent.exe
index 8c07b34..60b6c92 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 3df16d9..4a2d35a 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.unstripped.exe
b/agents/windows/check_mk_agent.unstripped.exe
index 9d28b6c..23b6ab5 100755
Binary files a/agents/windows/check_mk_agent.unstripped.exe and
b/agents/windows/check_mk_agent.unstripped.exe differ
diff --git a/agents/windows/check_mk_agent.unversioned.exe
b/agents/windows/check_mk_agent.unversioned.exe
index 9156883..f8ea1c4 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 16d98cc..396a9cf 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 4eb40cc..9ba5225 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 3be3ba2..db1186b 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 e70d627..242b052 100755
Binary files a/agents/windows/nowin.exe and b/agents/windows/nowin.exe differ