Module: check_mk
Branch: master
Commit: 649b42291dadca0f8944ff95b1a9f82892d6a646
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=649b42291dadca…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Jul 26 08:11:34 2018 +0200
Revert "6318 FIX check_mk_agent.{linux,solaris,openwrt}: Quote command line in
asynchronous MRPE call to prevent globbing and word splitting"
This reverts commit e1b633ad0fe84f3a1c2ce7923349bc0661d0034f.
---
.werks/6318 | 10 ----------
agents/check_mk_agent.linux | 4 ++--
agents/check_mk_agent.openwrt | 4 ++--
agents/check_mk_agent.solaris | 4 ++--
4 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/.werks/6318 b/.werks/6318
deleted file mode 100644
index 8f11e7b..0000000
--- a/.werks/6318
+++ /dev/null
@@ -1,10 +0,0 @@
-Title: check_mk_agent.{linux,solaris,openwrt}: Quote command line in asynchronous MRPE
call to prevent globbing and word splitting
-Level: 1
-Component: checks
-Compatible: compat
-Edition: cre
-Version: 1.6.0i1
-Date: 1532418648
-Class: fix
-
-
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 93ca7e4..8b7d8c4 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -264,9 +264,9 @@ function run_cached () {
if [ -z "$USE_CACHEFILE" ] && [ ! -e "$CACHEFILE.new" ] ;
then
# When the command fails, the output is throws away ignored
if [ $mrpe -eq 1 ] ; then
- echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; run_mrpe $NAME \"$CMDLINE\" && mv \"$CACHEFILE.new\"
\"$CACHEFILE\" || rm -f \"$CACHEFILE\"
\"$CACHEFILE.new\"" | nohup /bin/bash >/dev/null 2>&1 &
+ echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; run_mrpe $NAME $CMDLINE && mv \"$CACHEFILE.new\"
\"$CACHEFILE\" || rm -f \"$CACHEFILE\"
\"$CACHEFILE.new\"" | nohup /bin/bash >/dev/null 2>&1 &
else
- echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; \"$CMDLINE\" && mv \"$CACHEFILE.new\"
\"$CACHEFILE\" || rm -f \"$CACHEFILE\"
\"$CACHEFILE.new\"" | nohup /bin/bash >/dev/null 2>&1 &
+ echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; $CMDLINE && mv \"$CACHEFILE.new\" \"$CACHEFILE\" || rm -f
\"$CACHEFILE\" \"$CACHEFILE.new\"" | nohup /bin/bash
>/dev/null 2>&1 &
fi
fi
}
diff --git a/agents/check_mk_agent.openwrt b/agents/check_mk_agent.openwrt
index fdea879..463e56a 100755
--- a/agents/check_mk_agent.openwrt
+++ b/agents/check_mk_agent.openwrt
@@ -167,9 +167,9 @@ run_cached () {
# When the command fails, the output is throws away ignored
if [ $mrpe -eq 1 ] ; then
# TODO: This won't work: run_mrpe is not exported. And do we have bash at
all?
- echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; run_mrpe $NAME \"$CMDLINE\" && mv \"$CACHEFILE.new\"
\"$CACHEFILE\" || rm -f \"$CACHEFILE\"
\"$CACHEFILE.new\"" | nohup bash >/dev/null 2>&1 &
+ echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; run_mrpe $NAME $CMDLINE && mv \"$CACHEFILE.new\"
\"$CACHEFILE\" || rm -f \"$CACHEFILE\"
\"$CACHEFILE.new\"" | nohup bash >/dev/null 2>&1 &
else
- echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; \"$CMDLINE\" && mv \"$CACHEFILE.new\"
\"$CACHEFILE\" || rm -f \"$CACHEFILE\"
\"$CACHEFILE.new\"" | nohup bash >/dev/null 2>&1 &
+ echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; $CMDLINE && mv \"$CACHEFILE.new\" \"$CACHEFILE\" || rm -f
\"$CACHEFILE\" \"$CACHEFILE.new\"" | nohup bash >/dev/null
2>&1 &
fi
fi
}
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 0aefef3..7afe5b5 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -123,9 +123,9 @@ function run_cached () {
# Cache file outdated and new job not yet running? Start it
if [ -z "$USE_CACHEFILE" ] && [ ! -e "$CACHEFILE.new" ] ;
then
if [ $mrpe -eq 1 ] ; then
- echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; run_mrpe $NAME \"$CMDLINE\" && mv \"$CACHEFILE.new\"
\"$CACHEFILE\" || rm -f \"$CACHEFILE\"
\"$CACHEFILE.new\"" | nohup /usr/bin/bash >/dev/null 2>&1 &
+ echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; run_mrpe $NAME $CMDLINE && mv \"$CACHEFILE.new\"
\"$CACHEFILE\" || rm -f \"$CACHEFILE\"
\"$CACHEFILE.new\"" | nohup /usr/bin/bash >/dev/null 2>&1 &
else
- echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; \"$CMDLINE\" && mv \"$CACHEFILE.new\"
\"$CACHEFILE\" || rm -f \"$CACHEFILE\"
\"$CACHEFILE.new\"" | nohup /usr/bin/bash >/dev/null 2>&1 &
+ echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit
1 ; $CMDLINE && mv \"$CACHEFILE.new\" \"$CACHEFILE\" || rm -f
\"$CACHEFILE\" \"$CACHEFILE.new\"" | nohup /usr/bin/bash
>/dev/null 2>&1 &
fi
fi
}