summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3f9c019)
raw | patch | inline | side by side (parent: 3f9c019)
author | Marc Fournier <marc@bl.uem.li> | |
Mon, 23 Jan 2017 19:23:51 +0000 (20:23 +0100) | ||
committer | Marc Fournier <marc@bl.uem.li> | |
Mon, 23 Jan 2017 19:44:43 +0000 (20:44 +0100) |
debian/changelog | patch | blob | history | |
debian/patches/mqtt_invalid_symbols.patch | [new file with mode: 0644] | patch | blob |
debian/patches/series | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
index c3e61f605ecd7028f15f46befd753a1f4d035624..434f19b05c67daa6bd4949c597c4258e650d8d62 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
* debian/patches:
- drop dpdkstat-portable-format-string.patch, included upstream.
- add mqtt_resource_leak.patch, fixing a connection leak.
+ - add mqtt_invalid_symbols.patch, stripping out invalid characters from
+ MQTT topic names.
-- Marc Fournier <marc@bl.uem.li> Mon, 23 Jan 2017 09:23:07 +0100
diff --git a/debian/patches/mqtt_invalid_symbols.patch b/debian/patches/mqtt_invalid_symbols.patch
--- /dev/null
@@ -0,0 +1,26 @@
+Description: mqtt plugin: Fix invalid symbols in topic name.
+Author: Denys Fedoryshchenko <denys@visp.net.lb>
+
+diff --git a/src/mqtt.c b/src/mqtt.c
+index 6b76af97b..8a24ccaa0 100644
+--- a/src/mqtt.c
++++ b/src/mqtt.c
+@@ -462,6 +462,7 @@ static int format_topic(char *buf, size_t buf_len, data_set_t const *ds,
+ value_list_t const *vl, mqtt_client_conf_t *conf) {
+ char name[MQTT_MAX_TOPIC_SIZE];
+ int status;
++ char *c;
+
+ if ((conf->topic_prefix == NULL) || (conf->topic_prefix[0] == 0))
+ return (FORMAT_VL(buf, buf_len, vl));
+@@ -474,6 +475,10 @@ static int format_topic(char *buf, size_t buf_len, data_set_t const *ds,
+ if ((status < 0) || (((size_t)status) >= buf_len))
+ return (ENOMEM);
+
++ while((c = strchr(buf, '#')) || (c = strchr(buf, '+'))) {
++ *c = '_';
++ }
++
+ return (0);
+ } /* int format_topic */
+
diff --git a/debian/patches/series b/debian/patches/series
index b0cc80c093f4f6760ea0e503eb377c63ea2b6d6d..afc72edf62c18448e85ea0e74b46b5f0a7c1b2e2 100644 (file)
--- a/debian/patches/series
+++ b/debian/patches/series
myplugin_includes.patch
nagios-debian-paths.patch
mqtt_resource_leak.patch
+mqtt_invalid_symbols.patch