Module: check_mk
Branch: master
Commit: a29d57ddf2deb77ae185e6123c0a287b0629b1ea
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a29d57ddf2deb7…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Oct 11 14:24:11 2016 +0200
3649 FIX Added a workaround for an escaping-related bug in old bash versions
---
.werks/3649 | 13 +++++++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 11 +++++++++--
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/.werks/3649 b/.werks/3649
new file mode 100644
index 0000000..dbf19a8
--- /dev/null
+++ b/.werks/3649
@@ -0,0 +1,13 @@
+Title: Added a workaround for an escaping-related bug in old bash versions
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i2
+Date: 1476188198
+
+Some old bash versions (up to 3.2.x) had a slightly obscure bug regarding
+the escaping of special characters in regular expression matches, so a
+workaround for this was necessary.
+
diff --git a/ChangeLog b/ChangeLog
index a2b3f40..a0c28f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@
* 3935 FIX: FIX avaya_45xx_cpu: check got UNKNOWN using Nagios core
* 3896 FIX: Agent RPMs: Fixing dependency issue with old check_mk-agent-oracle-*.rpm and check_mk-agent-logwatch-*.rpm
* 3936 FIX: chrony: support new params dictionary and rule "State of NTP time synchronisation"
+ * 3649 FIX: Added a workaround for an escaping-related bug in old bash versions...
WATO:
* 3915 User access times: New icon when never logged in; New column "last seen"
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index c44f860..9844231 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -884,7 +884,10 @@ then
do
interval=
args="-m"
- if [[ $cmdline =~ \(([^\)]*)\)[[:space:]](.*) ]]
+ # NOTE: Due to an escaping-related bug in some old bash versions
+ # (3.2.x), we have to use an intermediate variable for the pattern.
+ pattern='\(([^\)]*)\)[[:space:]](.*)'
+ if [[ $cmdline =~ $pattern ]]
then
parameters=${BASH_REMATCH[1]}
cmdline=${BASH_REMATCH[2]}
@@ -931,7 +934,11 @@ then
while read descr cmdline
do
interval=
- if [[ $cmdline =~ \(([^\)]*)\)[[:space:]](.*) ]]
+ # NOTE: Due to an escaping-related bug in some old bash
+ # versions (3.2.x), we have to use an intermediate variable
+ # for the pattern.
+ pattern='\(([^\)]*)\)[[:space:]](.*)'
+ if [[ $cmdline =~ $pattern ]]
then
parameters=${BASH_REMATCH[1]}
cmdline=${BASH_REMATCH[2]}
Module: check_mk
Branch: master
Commit: 06bbfda1925be543f4a2da879497d15c85ffb8bf
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=06bbfda1925be5…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Oct 11 13:28:26 2016 +0200
fixed packaging
---
modules/packaging.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/packaging.py b/modules/packaging.py
index 57bf6cb..f3ea54d 100644
--- a/modules/packaging.py
+++ b/modules/packaging.py
@@ -287,9 +287,9 @@ def package_pack(args):
raise PackageException("Usage: check_mk -P pack NAME")
# Make sure, user is not in data directories of Check_MK
- p = os.path.abspath(os.curdir)
+ abs_curdir = os.path.abspath(os.curdir)
for dir in [cmk.paths.var_dir] + [ p[-1] for p in get_package_parts() ]:
- if p == dir or p.startswith(dir + "/"):
+ if abs_curdir == dir or abs_curdir.startswith(dir + "/"):
raise PackageException("You are in %s!\n"
"Please leave the directories of Check_MK before creating\n"
"a packet file. Foreign files lying around here will mix up things." % p)