Module: check_mk
Branch: master
Commit: 9a3c41f8ca4de7d1dc2fa37cb2622f22d3ffa89e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9a3c41f8ca4de7…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Wed Oct 23 11:32:46 2013 +0200
semicolons are no escaped and can be used in sql statements
---
checks/check_sql | 2 +-
doc/treasures/active_checks/check_sql | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/checks/check_sql b/checks/check_sql
index 4bd610e..8788947 100644
--- a/checks/check_sql
+++ b/checks/check_sql
@@ -48,7 +48,7 @@ def check_sql_arguments(params):
args += " -w %s:%s" % (lower[0], upper[0])
args += " -c %s:%s" % (lower[1], upper[1])
- sql_tmp = params["sql"].replace("\n", r"\n")
+ sql_tmp = params["sql"].replace("\n",
r"\n").replace(";", "\;")
args += " %s" % quote_shell_string(sql_tmp)
return args
diff --git a/doc/treasures/active_checks/check_sql
b/doc/treasures/active_checks/check_sql
index 8e84bb5..4d803ed 100755
--- a/doc/treasures/active_checks/check_sql
+++ b/doc/treasures/active_checks/check_sql
@@ -119,7 +119,7 @@ try:
if args:
opt_sql_tmp = ' '.join(map(str,args))
- opt_sql = opt_sql_tmp.replace(r"\n", "\n")
+ opt_sql = opt_sql_tmp.replace(r"\n",
"\n").replace('\;', ";")
else:
print "UNKNOWN - no SQL statement given"
sys.exit(3)