[icinga-checkins] icinga.org: icinga2/fix/influxwriter-escapes-12227: Add missing escapes

git at icinga.org git at icinga.org
Tue Aug 16 22:55:06 CEST 2016


Module: icinga2
Branch: fix/influxwriter-escapes-12227
Commit: 93dc0bdaea934c707c59b2e8c5b973e2ceaa1dc2
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=93dc0bdaea934c707c59b2e8c5b973e2ceaa1dc2

Author: Rune Darrud <theflyingcorpse at gmail.com>
Date:   Tue Aug 16 22:25:19 2016 +0200

Add missing escapes

fixes #12227

---

 lib/perfdata/influxdbwriter.cpp |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/perfdata/influxdbwriter.cpp b/lib/perfdata/influxdbwriter.cpp
index 608c417..b573c44 100644
--- a/lib/perfdata/influxdbwriter.cpp
+++ b/lib/perfdata/influxdbwriter.cpp
@@ -235,6 +235,8 @@ String InfluxdbWriter::EscapeKey(const String& str)
 {
 	// Iterate over the key name and escape commas and spaces with a backslash
 	String result = str;
+	boost::algorithm::replace_all(result, "\"", "\\\"");
+	boost::algorithm::replace_all(result, "=", "\\=");
 	boost::algorithm::replace_all(result, ",", "\\,");
 	boost::algorithm::replace_all(result, " ", "\\ ");
 



More information about the icinga-checkins mailing list