Module: check_mk
Branch: master
Commit: b6c8d73662f651956a957321c64a252369aa971b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6c8d73662f651…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Wed Jun 1 11:00:14 2016 +0200
windows agent: fixed crash when using rotated logs when there is no file matching the
pattern
---
agents/windows/Configuration.cc | 16 ++++++++++------
agents/windows/Makefile | 5 +++--
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 1268224 -> 1268224 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 1268224 -> 1268224 bytes
agents/windows/check_mk_agent.exe | Bin 1236992 -> 1362432 bytes
agents/windows/check_mk_agent.msi | Bin 2774016 -> 2900480 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 1236992 -> 1362432 bytes
agents/windows/install_agent-64.exe | Bin 565457 -> 565492 bytes
agents/windows/install_agent.exe | Bin 559756 -> 576150 bytes
10 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/agents/windows/Configuration.cc b/agents/windows/Configuration.cc
index 3c78797..18de0a8 100644
--- a/agents/windows/Configuration.cc
+++ b/agents/windows/Configuration.cc
@@ -544,12 +544,16 @@ bool Configuration::addNewRotatedLogfile(
}
BY_HANDLE_FILE_INFORMATION fileinfo;
- getFileInformation(textfile->paths.front().c_str(), &fileinfo);
- textfile->file_size =
- to_u64(fileinfo.nFileSizeLow, fileinfo.nFileSizeHigh);
- textfile->file_id =
- to_u64(fileinfo.nFileIndexLow, fileinfo.nFileIndexHigh);
- textfile->offset = token->from_start ? 0 : textfile->file_size;
+ if (textfile->paths.size() > 0) {
+ getFileInformation(textfile->paths.front().c_str(), &fileinfo);
+ textfile->file_size =
+ to_u64(fileinfo.nFileSizeLow, fileinfo.nFileSizeHigh);
+ textfile->file_id =
+ to_u64(fileinfo.nFileIndexLow, fileinfo.nFileIndexHigh);
+ textfile->offset = token->from_start ? 0 : textfile->file_size;
+ } else {
+ textfile->file_size = textfile->offset = textfile->file_id = 0;
+ }
}
_logwatch_textfiles.add(textfile);
diff --git a/agents/windows/Makefile b/agents/windows/Makefile
index d9c14a4..529d4c0 100644
--- a/agents/windows/Makefile
+++ b/agents/windows/Makefile
@@ -28,9 +28,10 @@ VERSION = 1.4.0i1
VERSION_DUMMY = @@@@@CHECK_MK_VERSION@@@@@
WINDRES = i686-w64-mingw32-windres
GIT_REV = $(shell git describe --abbrev=4 --dirty --always --tags)
-COPTIONS = -O2 -gdwarf-2 -Wall -Wformat=2 -Werror -static -static-libgcc
-static-libstdc++ -fno-rtti -std=c++11
-DCHECK_MK_VERSION='"$(VERSION_DUMMY)"' -D__USE_MINGW_ANSI_STDIO
-DVCS_REV=\"$(GIT_REV)\"
+COMMON_OPTS = -Wall -static -static-libgcc -static-libstdc++ -fno-rtti -std=c++11
-gdwarf-2 -DCHECK_MK_VERSION='"$(VERSION_DUMMY)"'
-D__USE_MINGW_ANSI_STDIO -DVCS_REV=\"$(GIT_REV)\"
+COPTIONS = -O2 -Wformat=2 -Werror $(COMMON_OPTS)
# for debug builds
-#COPTIONS = -O0 -Wall -static -static-libgcc -static-libstdc++ -fno-rtti -std=c++11
-gdwarf-2 -DCHECK_MK_VERSION='"$(VERSION_DUMMY)"'
-D__USE_MINGW_ANSI_STDIO
+#COPTIONS = -O0 $(COMMON_OPTS)
MKDIR = mkdir -p
ifeq ($(shell uname),Linux)
diff --git a/agents/windows/build_version b/agents/windows/build_version
index 32bb421..e6a6560 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-1729
+1739
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index d3967ef..c880535 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 9045168..5e2d4cb 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 1b153d1..8a7ec03 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 cd9c482..2129407 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 bd487ea..d8833ad 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 ad52d80..c1dd3f4 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 64aeae5..c0f0c52 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe
differ