summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 05f467f)
raw | patch | inline | side by side (parent: 05f467f)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 30 Jun 2015 05:23:39 +0000 (07:23 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 30 Jun 2015 05:23:39 +0000 (07:23 +0200) |
12 files changed:
debian/changelog | patch | blob | history | |
debian/patches/00list | patch | blob | history | |
debian/patches/bts559801_plugin_find_fix.dpatch | [deleted file] | patch | blob | history |
debian/patches/bts747093_lvm_segfault.dpatch | [deleted file] | patch | blob | history |
debian/patches/bts750440_config_segfault.dpatch | [deleted file] | patch | blob | history |
debian/patches/bts770681_riemann_ack.dpatch | [deleted file] | patch | blob | history |
debian/patches/bts770683_curl_init.dpatch | [deleted file] | patch | blob | history |
debian/patches/bts770688_snmp_memleak.dpatch | [deleted file] | patch | blob | history |
debian/patches/bts770690_java_jni_thread_detach.dpatch | [deleted file] | patch | blob | history |
debian/patches/bts770693_timestamps.dpatch | [deleted file] | patch | blob | history |
debian/patches/bts770694_loglevel.dpatch | [deleted file] | patch | blob | history |
debian/patches/myplugin_api.dpatch | [deleted file] | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
index 4b8f0d321ca253155b9acc66254fe3e944a6b48c..c79e935df1bcf4ecd0c289c5e385bd8009969164 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
collectd (5.5.0-1) UNRELEASED; urgency=medium
* New upstream release.
+ * debian/patches:
+ - Removed bts559801_plugin_find_fix.dpatch; merged upstream.
+ - Removed bts747093_lvm_segfault.dpatch; merged upstream.
+ - Removed bts750440_config_segfault.dpatch; merged upstream.
+ - Removed bts770681_riemann_ack.dpatch; merged upstream.
+ - Removed bts770683_curl_init.dpatch; merged upstream.
+ - Removed bts770688_snmp_memleak.dpatch; merged upstream.
+ - Removed bts770690_java_jni_thread_detach.dpatch; merged upstream.
+ - Removed bts770693_timestamps.dpatch; merged upstream.
+ - Removed bts770694_loglevel.dpatch; merged upstream.
+ - Removed myplugin_api.dpatch; merged upstream.
-- Marc Fournier <marc.fournier@camptocamp.com> Tue, 30 Jun 2015 07:08:39 +0200
diff --git a/debian/patches/00list b/debian/patches/00list
index f9939c617a79aa0a71b119a0b7e39be8dee43f9e..f2785c352810128f3476661f4e721edac42051c1 100644 (file)
--- a/debian/patches/00list
+++ b/debian/patches/00list
collection_conf_path.dpatch
collection.cgi.dpatch
myplugin_includes.dpatch
-myplugin_api.dpatch
-bts559801_plugin_find_fix.dpatch
-bts770681_riemann_ack.dpatch
-bts747093_lvm_segfault.dpatch
-bts770683_curl_init.dpatch
-bts750440_config_segfault.dpatch
-bts770688_snmp_memleak.dpatch
-bts770690_java_jni_thread_detach.dpatch
-bts770693_timestamps.dpatch
-bts770694_loglevel.dpatch
diff --git a/debian/patches/bts559801_plugin_find_fix.dpatch b/debian/patches/bts559801_plugin_find_fix.dpatch
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## bts559801_plugin_find_fix.dpatch by Sebastian Harl <sh@tokkee.org>
-##
-## DP: plugin: Use strcasecmp rather than strncasecmp to find a plugin.
-## DP:
-## DP: This makes collectd resistant against vulnerable copies of libltdl
-## DP: (CVE-2009-3736).
-## DP: See <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559801#15>
-## DP: for details.
-
-@DPATCH@
-
-diff a/src/plugin.c b/src/plugin.c
---- a/src/plugin.c
-+++ b/src/plugin.c
-@@ -592,7 +592,6 @@
- const char *dir;
- char filename[BUFSIZE] = "";
- char typename[BUFSIZE];
-- int typename_len;
- int ret;
- struct stat statbuf;
- struct dirent *de;
-@@ -611,7 +610,6 @@
- WARNING ("snprintf: truncated: `%s.so'", type);
- return (-1);
- }
-- typename_len = strlen (typename);
-
- if ((dh = opendir (dir)) == NULL)
- {
-@@ -623,7 +621,7 @@
-
- while ((de = readdir (dh)) != NULL)
- {
-- if (strncasecmp (de->d_name, typename, typename_len))
-+ if (strcasecmp (de->d_name, typename))
- continue;
-
- status = ssnprintf (filename, sizeof (filename),
diff --git a/debian/patches/bts747093_lvm_segfault.dpatch b/debian/patches/bts747093_lvm_segfault.dpatch
+++ /dev/null
@@ -1,29 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-##
-## DP: bts747093_lvm_segfault.dpatch by Jan Kundrát <jan.kundrat@cesnet.cz>
-## DP:
-## DP: lvm: Fix segfault when there are no logical volumes.
-## DP:
-## DP: Upstream bug report:
-## DP: https://github.com/collectd/collectd/issues/558
-## DP:
-## DP: Upstream commit:
-## DP: https://github.com/jktjkt/collectd/commit/40dde67
-
-@DPATCH@
-
-diff a/src/lvm.c b/src/lvm.c
---- a/src/lvm.c
-+++ b/src/lvm.c
-@@ -53,6 +53,11 @@ static int vg_read(vg_t vg, char const *vg_name)
- lvm_submit (vg_name, "free", lvm_vg_get_free_size(vg));
-
- lvs = lvm_vg_list_lvs(vg);
-+ if (!lvs) {
-+ /* no VGs are defined, which is not an error per se */
-+ return (0);
-+ }
-+
- dm_list_iterate_items(lvl, lvs) {
- lvm_submit(vg_name, lvm_lv_get_name(lvl->lv), lvm_lv_get_size(lvl->lv));
- }
diff --git a/debian/patches/bts750440_config_segfault.dpatch b/debian/patches/bts750440_config_segfault.dpatch
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## bts750440_config_segfault.dpatch by Wilfried Goesgens <dothebart@citadel.org>
-##
-## DP: Fixed a segfault when handling/including empty config files.
-## DP:
-## DP: Correctly handle the case of empty "children" nodes.
-## DP:
-## DP: Upstream bug report:
-## DP: https://github.com/collectd/collectd/issues/638
-## DP:
-## DP: Upstream commit:
-## DP: https://github.com/dothebart/collectd/commit/2923883
-
-@DPATCH@
-
-diff a/src/configfile.c b/src/configfile.c
---- a/src/configfile.c
-+++ b/src/configfile.c
-@@ -414,6 +414,12 @@ static int cf_ci_replace_child (oconfig_item_t *dst, oconfig_item_t *src,
-
- /* Resize the memory containing the children to be big enough to hold
- * all children. */
-+ if (dst->children_num + src->children_num - 1 == 0)
-+ {
-+ dst->children_num = 0;
-+ return (0);
-+ }
-+
- temp = (oconfig_item_t *) realloc (dst->children,
- sizeof (oconfig_item_t)
- * (dst->children_num + src->children_num - 1));
-@@ -514,7 +520,8 @@ static int cf_include_all (oconfig_item_t *root, int depth)
- continue;
-
- /* Now replace the i'th child in `root' with `new'. */
-- cf_ci_replace_child (root, new, i);
-+ if (cf_ci_replace_child (root, new, i) < 0)
-+ return (-1);
-
- /* ... and go back to the new i'th child. */
- --i;
diff --git a/debian/patches/bts770681_riemann_ack.dpatch b/debian/patches/bts770681_riemann_ack.dpatch
+++ /dev/null
@@ -1,171 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## bts770681_riemann_ack.dpatch by John-John Tedro <udoprog@spotify.com>
-##
-## DP: write_riemann plugin: Receive acknowledge message when using TCP.
-## DP:
-## DP: Not receiving an acknowledge message when communicating with riemann
-## DP: over TCP will cause the riemann instance to eventually hang for
-## DP: extended periods of time because of resource exhaustion.
-## DP:
-## DP: Upstream bug report:
-## DP: https://github.com/collectd/collectd/pull/425
-## DP:
-## DP: Upstream commit:
-## DP: https://github.com/spotify/collectd/commit/78c0678
-
-@DPATCH@
-
-diff a/src/write_riemann.c b/src/write_riemann.c
---- a/src/write_riemann.c
-+++ b/src/write_riemann.c
-@@ -176,32 +176,30 @@ riemann_disconnect (struct riemann_host *host)
- return (0);
- }
-
--static int
--riemann_send(struct riemann_host *host, Msg const *msg)
-+static inline int
-+riemann_send_msg(struct riemann_host *host, const Msg *msg)
- {
-- u_char *buffer;
-+ int status = 0;
-+ u_char *buffer = NULL;
- size_t buffer_len;
-- int status;
--
-- pthread_mutex_lock (&host->lock);
-
- status = riemann_connect (host);
-+
- if (status != 0)
-- {
-- pthread_mutex_unlock (&host->lock);
- return status;
-- }
-
- buffer_len = msg__get_packed_size(msg);
-+
- if (host->use_tcp)
- buffer_len += 4;
-
- buffer = malloc (buffer_len);
-+
- if (buffer == NULL) {
-- pthread_mutex_unlock (&host->lock);
- ERROR ("write_riemann plugin: malloc failed.");
- return ENOMEM;
- }
-+
- memset (buffer, 0, buffer_len);
-
- if (host->use_tcp)
-@@ -216,26 +214,105 @@ riemann_send(struct riemann_host *host, Msg const *msg)
- }
-
- status = (int) swrite (host->s, buffer, buffer_len);
-+
- if (status != 0)
- {
- char errbuf[1024];
-
-- riemann_disconnect (host);
-- pthread_mutex_unlock (&host->lock);
--
- ERROR ("write_riemann plugin: Sending to Riemann at %s:%s failed: %s",
- (host->node != NULL) ? host->node : RIEMANN_HOST,
- (host->service != NULL) ? host->service : RIEMANN_PORT,
- sstrerror (errno, errbuf, sizeof (errbuf)));
-+
- sfree (buffer);
- return -1;
- }
-
-- pthread_mutex_unlock (&host->lock);
- sfree (buffer);
- return 0;
- }
-
-+static inline int
-+riemann_recv_ack(struct riemann_host *host)
-+{
-+ int status = 0;
-+ Msg *msg = NULL;
-+ uint32_t header;
-+
-+ status = (int) sread (host->s, &header, 4);
-+
-+ if (status != 0)
-+ return -1;
-+
-+ size_t size = ntohl(header);
-+
-+ // Buffer on the stack since acknowledges are typically small.
-+ u_char buffer[size];
-+ memset (buffer, 0, size);
-+
-+ status = (int) sread (host->s, buffer, size);
-+
-+ if (status != 0)
-+ return status;
-+
-+ msg = msg__unpack (NULL, size, buffer);
-+
-+ if (msg == NULL)
-+ return -1;
-+
-+ if (!msg->ok)
-+ {
-+ ERROR ("write_riemann plugin: Sending to Riemann at %s:%s acknowledgement message reported error: %s",
-+ (host->node != NULL) ? host->node : RIEMANN_HOST,
-+ (host->service != NULL) ? host->service : RIEMANN_PORT,
-+ msg->error);
-+
-+ msg__free_unpacked(msg, NULL);
-+ return -1;
-+ }
-+
-+ msg__free_unpacked (msg, NULL);
-+ return 0;
-+}
-+
-+/**
-+ * Function to send messages (Msg) to riemann.
-+ *
-+ * Acquires the host lock, disconnects on errors.
-+ */
-+static int
-+riemann_send(struct riemann_host *host, Msg const *msg)
-+{
-+ int status = 0;
-+ pthread_mutex_lock (&host->lock);
-+
-+ status = riemann_send_msg(host, msg);
-+
-+ if (status != 0) {
-+ riemann_disconnect (host);
-+ pthread_mutex_unlock (&host->lock);
-+ return status;
-+ }
-+
-+ /*
-+ * For TCP we need to receive message acknowledgemenent.
-+ */
-+ if (host->use_tcp)
-+ {
-+ status = riemann_recv_ack(host);
-+
-+ if (status != 0)
-+ {
-+ riemann_disconnect (host);
-+ pthread_mutex_unlock (&host->lock);
-+ return status;
-+ }
-+ }
-+
-+ pthread_mutex_unlock (&host->lock);
-+ return 0;
-+}
-+
- static int riemann_event_add_tag (Event *event, char const *tag) /* {{{ */
- {
- return (strarray_add (&event->tags, &event->n_tags, tag));
diff --git a/debian/patches/bts770683_curl_init.dpatch b/debian/patches/bts770683_curl_init.dpatch
+++ /dev/null
@@ -1,95 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## bts770683_curl_init.dpatch by Jeremy Katz <jeremy@katzbox.net>
-##
-## DP: Call curl_global_init() in _init of plugins using curl.
-## DP:
-## DP: curl_global_init() or curl_easy_init() has to be called in the init
-## DP: callback of plugins using curl while collectd still runs single
-## DP: threaded. Else, collectd may crash with a segfault due to concurrent
-## DP: memory access by curl.
-## DP:
-## DP: Upstream bug report:
-## DP: https://github.com/collectd/collectd/issues/526
-## DP:
-## DP: Upstream commits:
-## DP: https://github.com/katzj/collectd/commit/401fa6e
-
-@DPATCH@
-
-diff a/src/curl.c b/src/curl.c
---- a/src/curl.c
-+++ b/src/curl.c
-@@ -569,6 +569,7 @@ static int cc_init (void) /* {{{ */
- INFO ("curl plugin: No pages have been defined.");
- return (-1);
- }
-+ curl_global_init (CURL_GLOBAL_SSL);
- return (0);
- } /* }}} int cc_init */
-
-diff a/src/curl_json.c b/src/curl_json.c
---- a/src/curl_json.c
-+++ b/src/curl_json.c
-@@ -957,9 +957,18 @@ static int cj_read (user_data_t *ud) /* {{{ */
- return cj_perform (db);
- } /* }}} int cj_read */
-
-+static int cj_init (void) /* {{{ */
-+{
-+ /* Call this while collectd is still single-threaded to avoid
-+ * initialization issues in libgcrypt. */
-+ curl_global_init (CURL_GLOBAL_SSL);
-+ return (0);
-+} /* }}} int cj_init */
-+
- void module_register (void)
- {
- plugin_register_complex_config ("curl_json", cj_config);
-+ plugin_register_init ("curl_json", cj_init);
- } /* void module_register */
-
- /* vim: set sw=2 sts=2 et fdm=marker : */
-diff a/src/curl_xml.c b/src/curl_xml.c
---- a/src/curl_xml.c
-+++ b/src/curl_xml.c
-@@ -1033,9 +1033,18 @@ static int cx_config (oconfig_item_t *ci) /* {{{ */
- return (0);
- } /* }}} int cx_config */
-
-+static int cx_init (void) /* {{{ */
-+{
-+ /* Call this while collectd is still single-threaded to avoid
-+ * initialization issues in libgcrypt. */
-+ curl_global_init (CURL_GLOBAL_SSL);
-+ return (0);
-+} /* }}} int cx_init */
-+
- void module_register (void)
- {
- plugin_register_complex_config ("curl_xml", cx_config);
-+ plugin_register_init ("curl_xml", cx_init);
- } /* void module_register */
-
- /* vim: set sw=2 sts=2 et fdm=marker : */
-diff a/src/write_http.c b/src/write_http.c
---- a/src/write_http.c
-+++ b/src/write_http.c
-@@ -590,9 +590,18 @@ static int wh_config (oconfig_item_t *ci) /* {{{ */
- return (0);
- } /* }}} int wh_config */
-
-+static int wh_init (void) /* {{{ */
-+{
-+ /* Call this while collectd is still single-threaded to avoid
-+ * initialization issues in libgcrypt. */
-+ curl_global_init (CURL_GLOBAL_SSL);
-+ return (0);
-+} /* }}} int wh_init */
-+
- void module_register (void) /* {{{ */
- {
- plugin_register_complex_config ("write_http", wh_config);
-+ plugin_register_init ("write_http", wh_init);
- } /* }}} void module_register */
-
- /* vim: set fdm=marker sw=8 ts=8 tw=78 et : */
diff --git a/debian/patches/bts770688_snmp_memleak.dpatch b/debian/patches/bts770688_snmp_memleak.dpatch
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## bts770688_snmp_memleak.dpatch by Pierre-Yves Ritschard <pyr@spootnik.org>
-## and Marc Fournier <marc.fournier@camptocamp.com>
-##
-## DP: Let snmp_synch_response deal with PDU freeing
-## DP:
-## DP: When reading from tables, upon errors the PDUs sent are already
-## DP: freed by snmp_synch_response since they are right after
-## DP: snmp_send is called.
-## DP:
-## DP: This commit syncs collectd's approach with other occurences of
-## DP: snmp_synch_response calls.
-## DP:
-## DP: There might be a few corner cases where we leak PDUs, but it
-## DP: is unclear how to check for those since we would need to
-## DP: have an indication that snmp_send was never called, which
-## DP: as far as I can tell is not possible.
-## DP:
-## DP: The potential for failure in snmp_send is rather low and will
-## DP: be easily spotted though, since when crafting invalid PDUs
-## DP: snmp send will constantly fail and since valid configurations
-## DP: can never leak memory.
-## DP:
-## DP: Upstream bug reports:
-## DP: https://github.com/collectd/collectd/issues/610
-## DP: https://github.com/collectd/collectd/issues/804
-
-@DPATCH@
-
-diff --git a/src/snmp.c b/src/snmp.c
-index ad81c89..7d340d1 100644
---- a/src/snmp.c
-+++ b/src/snmp.c
-@@ -1316,6 +1316,8 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
- snmp_free_pdu (res);
- res = NULL;
-
-+ /* snmp_synch_response already freed our PDU */
-+ req = NULL;
- sfree (errstr);
- csnmp_host_close_session (host);
-
-@@ -1437,6 +1439,10 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
- snmp_free_pdu (res);
- res = NULL;
-
-+ if (req != NULL)
-+ snmp_free_pdu (req);
-+ req = NULL;
-+
- if (status == 0)
- csnmp_dispatch_table (host, data, instance_list_head, value_list_head);
-
diff --git a/debian/patches/bts770690_java_jni_thread_detach.dpatch b/debian/patches/bts770690_java_jni_thread_detach.dpatch
+++ /dev/null
@@ -1,205 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## bts770690_java_jni_thread_detach.dpatch by Florian Forster <octo@google.com>
-##
-## DP: java plugin: Make sure cjni_thread_detach() is called on all paths.
-## DP: Each call to cjni_thread_attach() much be accompanied by a call to
-## DP: cjni_thread_detach(). Some error handling cases were missing the call,
-## DP: potentially locking the plugin up.
-## DP:
-## DP: Also ensure that cjni_thread_detach() does not hide the status of other
-## DP: operations.
-## DP:
-## DP: Upstream commit:
-## DP: https://github.com/collectd/collectd/commit/513a5ca
-
-@DPATCH@
-
-diff a/src/java.c b/src/java.c
---- a/src/java.c
-+++ b/src/java.c
-@@ -2115,7 +2115,7 @@ static int cjni_thread_detach (void) /* {{{ */
- cjni_env->jvm_env = NULL;
-
- return (0);
--} /* }}} JNIEnv *cjni_thread_attach */
-+} /* }}} int cjni_thread_detach */
-
- static int cjni_config_add_jvm_arg (oconfig_item_t *ci) /* {{{ */
- {
-@@ -2468,7 +2468,6 @@ static int cjni_read (user_data_t *ud) /* {{{ */
- {
- JNIEnv *jvm_env;
- cjni_callback_info_t *cbi;
-- int status;
- int ret_status;
-
- if (jvm == NULL)
-@@ -2492,13 +2491,7 @@ static int cjni_read (user_data_t *ud) /* {{{ */
- ret_status = (*jvm_env)->CallIntMethod (jvm_env, cbi->object,
- cbi->method);
-
-- status = cjni_thread_detach ();
-- if (status != 0)
-- {
-- ERROR ("java plugin: cjni_read: cjni_thread_detach failed.");
-- return (-1);
-- }
--
-+ cjni_thread_detach ();
- return (ret_status);
- } /* }}} int cjni_read */
-
-@@ -2509,7 +2502,6 @@ static int cjni_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */
- JNIEnv *jvm_env;
- cjni_callback_info_t *cbi;
- jobject vl_java;
-- int status;
- int ret_status;
-
- if (jvm == NULL)
-@@ -2534,6 +2526,7 @@ static int cjni_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */
- if (vl_java == NULL)
- {
- ERROR ("java plugin: cjni_write: ctoj_value_list failed.");
-+ cjni_thread_detach ();
- return (-1);
- }
-
-@@ -2542,13 +2535,7 @@ static int cjni_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */
-
- (*jvm_env)->DeleteLocalRef (jvm_env, vl_java);
-
-- status = cjni_thread_detach ();
-- if (status != 0)
-- {
-- ERROR ("java plugin: cjni_write: cjni_thread_detach failed.");
-- return (-1);
-- }
--
-+ cjni_thread_detach ();
- return (ret_status);
- } /* }}} int cjni_write */
-
-@@ -2560,7 +2547,6 @@ static int cjni_flush (cdtime_t timeout, const char *identifier, /* {{{ */
- cjni_callback_info_t *cbi;
- jobject o_timeout;
- jobject o_identifier;
-- int status;
- int ret_status;
-
- if (jvm == NULL)
-@@ -2587,6 +2573,7 @@ static int cjni_flush (cdtime_t timeout, const char *identifier, /* {{{ */
- {
- ERROR ("java plugin: cjni_flush: Converting double "
- "to Number object failed.");
-+ cjni_thread_detach ();
- return (-1);
- }
-
-@@ -2598,6 +2585,7 @@ static int cjni_flush (cdtime_t timeout, const char *identifier, /* {{{ */
- {
- (*jvm_env)->DeleteLocalRef (jvm_env, o_timeout);
- ERROR ("java plugin: cjni_flush: NewStringUTF failed.");
-+ cjni_thread_detach ();
- return (-1);
- }
- }
-@@ -2608,13 +2596,7 @@ static int cjni_flush (cdtime_t timeout, const char *identifier, /* {{{ */
- (*jvm_env)->DeleteLocalRef (jvm_env, o_identifier);
- (*jvm_env)->DeleteLocalRef (jvm_env, o_timeout);
-
-- status = cjni_thread_detach ();
-- if (status != 0)
-- {
-- ERROR ("java plugin: cjni_flush: cjni_thread_detach failed.");
-- return (-1);
-- }
--
-+ cjni_thread_detach ();
- return (ret_status);
- } /* }}} int cjni_flush */
-
-@@ -2640,7 +2622,10 @@ static void cjni_log (int severity, const char *message, /* {{{ */
-
- o_message = (*jvm_env)->NewStringUTF (jvm_env, message);
- if (o_message == NULL)
-+ {
-+ cjni_thread_detach ();
- return;
-+ }
-
- (*jvm_env)->CallVoidMethod (jvm_env,
- cbi->object, cbi->method, (jint) severity, o_message);
-@@ -2658,7 +2643,6 @@ static int cjni_notification (const notification_t *n, /* {{{ */
- JNIEnv *jvm_env;
- cjni_callback_info_t *cbi;
- jobject o_notification;
-- int status;
- int ret_status;
-
- if (jvm == NULL)
-@@ -2683,6 +2667,7 @@ static int cjni_notification (const notification_t *n, /* {{{ */
- if (o_notification == NULL)
- {
- ERROR ("java plugin: cjni_notification: ctoj_notification failed.");
-+ cjni_thread_detach ();
- return (-1);
- }
-
-@@ -2691,13 +2676,7 @@ static int cjni_notification (const notification_t *n, /* {{{ */
-
- (*jvm_env)->DeleteLocalRef (jvm_env, o_notification);
-
-- status = cjni_thread_detach ();
-- if (status != 0)
-- {
-- ERROR ("java plugin: cjni_read: cjni_thread_detach failed.");
-- return (-1);
-- }
--
-+ cjni_thread_detach ();
- return (ret_status);
- } /* }}} int cjni_notification */
-
-@@ -2725,24 +2704,20 @@ static int cjni_match_target_create (const oconfig_item_t *ci, /* {{{ */
- (*jvm_env)->DeleteLocalRef (jvm_env, cbi_ret->object); \
- } \
- free (cbi_ret); \
-- if (jvm_env != NULL) { \
-- if (o_ci != NULL) \
-- (*jvm_env)->DeleteLocalRef (jvm_env, o_ci); \
-- cjni_thread_detach (); \
-- } \
-+ if (o_ci != NULL) \
-+ (*jvm_env)->DeleteLocalRef (jvm_env, o_ci); \
-+ cjni_thread_detach (); \
- return (status)
-
- if (jvm == NULL)
- {
- ERROR ("java plugin: cjni_read: jvm == NULL");
-- BAIL_OUT (-1);
-+ return (-1);
- }
-
- jvm_env = cjni_thread_attach ();
- if (jvm_env == NULL)
-- {
-- BAIL_OUT (-1);
-- }
-+ return (-1);
-
- /* Find out whether to create a match or a target. */
- if (strcasecmp ("Match", ci->key) == 0)
-@@ -2936,10 +2911,7 @@ static int cjni_match_target_invoke (const data_set_t *ds, /* {{{ */
- }
- } /* if (cbi->type == CB_TYPE_TARGET) */
-
-- status = cjni_thread_detach ();
-- if (status != 0)
-- ERROR ("java plugin: cjni_read: cjni_thread_detach failed.");
--
-+ cjni_thread_detach ();
- return (ret_status);
- } /* }}} int cjni_match_target_invoke */
-
diff --git a/debian/patches/bts770693_timestamps.dpatch b/debian/patches/bts770693_timestamps.dpatch
+++ /dev/null
@@ -1,124 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## bts770693_timestamps.dpatch
-##
-## DP: Fixed handling of timestamps in notifications.
-## DP:
-## DP: Starting with collectd 5, timestamps use nano-second resolution rather
-## DP: than seconds. Notitications did not handle that correctly, leading to
-## DP: invalid time-stamps and potentially invalid memory access.
-## DP:
-## DP: Upstream commits:
-## DP: https://github.com/collectd/collectd/commit/...
-## DP: d571f4645593c16a26a98aa635b1952286089266 by Justin Burnham <jburnham@mediatemple.net>
-## DP: 43fcfd6a48b506b03114dd9637caf8fc211b47db by Adrian Miron <adrian.miron.v2@gmail.com>
-## DP: ac78faa99d4b34c78a7bca741430c06c56e6f32c by Manuel Luis Sanmartín Rozada <manuel.luis@gmail.com>
-## DP: f5c294b7355cee34df44b1c5b8ac3ef7b85664cd by Manuel Luis Sanmartín Rozada <manuel.luis@gmail.com>
-## DP: 7d1d59fb064f2a9adfba50d3ea5c39ebc6bebd3c by Manuel Luis Sanmartín Rozada <manuel.luis@gmail.com>
-## DP: 07e4683f7f985668641d79137b64d148bc18ba8a by Manuel Luis Sanmartín Rozada <manuel.luis@gmail.com>
-## DP: 524b85687dbbd4cc2bbb650caf300162dcd16e96 by Marc Fournier <marc.fournier@camptocamp.com>
-
-@DPATCH@
-
-diff a/src/exec.c b/src/exec.c
---- a/src/exec.c
-+++ b/src/exec.c
-@@ -744,8 +744,8 @@ static void *exec_notification_one (void *arg) /* {{{ */
-
- fprintf (fh,
- "Severity: %s\n"
-- "Time: %.3f\n",
-- severity, CDTIME_T_TO_DOUBLE (n->time));
-+ "Time: %u\n",
-+ severity, (unsigned int)CDTIME_T_TO_TIME_T(n->time));
-
- /* Print the optional fields */
- if (strlen (n->host) > 0)
-diff a/src/java.c b/src/java.c
---- a/src/java.c
-+++ b/src/java.c
-@@ -906,7 +906,7 @@ static jobject ctoj_notification (JNIEnv *jvm_env, /* {{{ */
- #undef SET_STRING
-
- /* Set the `time' member. Java stores time in milliseconds. */
-- status = ctoj_long (jvm_env, ((jlong) n->time) * ((jlong) 1000),
-+ status = ctoj_long (jvm_env, (jlong) CDTIME_T_TO_MS (n->time),
- c_notification, o_notification, "setTime");
- if (status != 0)
- {
-@@ -1306,7 +1306,7 @@ static int jtoc_notification (JNIEnv *jvm_env, notification_t *n, /* {{{ */
- return (-1);
- }
- /* Java measures time in milliseconds. */
-- n->time = (time_t) (tmp_long / ((jlong) 1000));
-+ n->time = MS_TO_CDTIME_T(tmp_long);
-
- status = jtoc_int (jvm_env, &tmp_int,
- class_ptr, object_ptr, "getSeverity");
-
-diff a/src/pyvalues.c b/src/pyvalues.c
---- a/src/pyvalues.c
-+++ b/src/pyvalues.c
-@@ -767,7 +771,7 @@ static void Values_dealloc(PyObject *self) {
- }
-
- static PyMemberDef Values_members[] = {
-- {"interval", T_INT, offsetof(Values, interval), 0, interval_doc},
-+ {"interval", T_DOUBLE, offsetof(Values, interval), 0, interval_doc},
- {"values", T_OBJECT_EX, offsetof(Values, values), 0, values_doc},
- {"meta", T_OBJECT_EX, offsetof(Values, meta), 0, meta_doc},
- {NULL}
-diff a/src/threshold.c b/src/threshold.c
---- a/src/threshold.c
-+++ b/src/threshold.c
-@@ -942,6 +942,7 @@ static int ut_missing (const value_list_t *vl,
- cdtime_t missing_time;
- char identifier[6 * DATA_MAX_NAME_LEN];
- notification_t n;
-+ cdtime_t now;
-
- if (threshold_tree == NULL)
- return (0);
-@@ -951,13 +952,15 @@ static int ut_missing (const value_list_t *vl,
- if ((th == NULL) || ((th->flags & UT_FLAG_INTERESTING) == 0))
- return (0);
-
-- missing_time = cdtime () - vl->time;
-+ now = cdtime ();
-+ missing_time = now - vl->time;
- FORMAT_VL (identifier, sizeof (identifier), vl);
-
- NOTIFICATION_INIT_VL (&n, vl);
- ssnprintf (n.message, sizeof (n.message),
- "%s has not been updated for %.3f seconds.",
- identifier, CDTIME_T_TO_DOUBLE (missing_time));
-+ n.time = now;
-
- plugin_dispatch_notification (&n);
-
-diff a/src/utils_cmd_putnotif.c b/src/utils_cmd_putnotif.c
---- a/src/utils_cmd_putnotif.c
-+++ b/src/utils_cmd_putnotif.c
-@@ -49,13 +49,18 @@ static int set_option_severity (notification_t *n, const char *value)
-
- static int set_option_time (notification_t *n, const char *value)
- {
-- time_t tmp;
--
-- tmp = (time_t) atoi (value);
-- if (tmp <= 0)
-+ char *endptr = NULL;
-+ double tmp;
-+
-+ errno = 0;
-+ tmp = strtod (value, &endptr);
-+ if ((errno != 0) /* Overflow */
-+ || (endptr == value) /* Invalid string */
-+ || (endptr == NULL) /* This should not happen */
-+ || (*endptr != 0)) /* Trailing chars */
- return (-1);
-
-- n->time = tmp;
-+ n->time = DOUBLE_TO_CDTIME_T (tmp);
-
- return (0);
- } /* int set_option_time */
diff --git a/debian/patches/bts770694_loglevel.dpatch b/debian/patches/bts770694_loglevel.dpatch
+++ /dev/null
@@ -1,49 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## bts770694_loglevel.dpatch
-##
-## DP: Make sure not to disable logging on invalid log levels.
-## DP:
-## DP: Debug logging is not compiled into the Debian packages. Make sure to
-## DP: fall back to INFO and report and error rather than silently dropping
-## DP: all further log messages.
-## DP:
-## DP: Upstream bug report:
-## DP: https://github.com/collectd/collectd/issues/636
-## DP:
-## DP: Upstream commits:
-## DP: https://github.com/dothebart/collectd/commit/84c3805
-## DP: https://github.com/collectd/collectd/commit/cb4ea71
-
-@DPATCH@
-
-diff a/src/logfile.c b/src/logfile.c
---- a/src/logfile.c
-+++ b/src/logfile.c
-@@ -54,7 +54,11 @@ static int logfile_config (const char *key, const char *value)
- {
- if (0 == strcasecmp (key, "LogLevel")) {
- log_level = parse_log_severity(value);
-- if (log_level == -1) return 1; /* to keep previous behaviour */
-+ if (log_level < 0) {
-+ log_level = LOG_INFO;
-+ ERROR ("logfile: invalid loglevel [%s] defaulting to 'info'", value);
-+ return (1);
-+ }
- }
- else if (0 == strcasecmp (key, "File")) {
- sfree (log_file);
-diff a/src/syslog.c b/src/syslog.c
---- a/src/syslog.c
-+++ b/src/syslog.c
-@@ -48,7 +48,11 @@ static int sl_config (const char *key, const char *value)
- {
- log_level = parse_log_severity (value);
- if (log_level < 0)
-+ {
-+ log_level = LOG_INFO;
-+ ERROR ("syslog: invalid loglevel [%s] defaulting to 'info'", value);
- return (1);
-+ }
- }
- else if (strcasecmp (key, "NotifyLevel") == 0)
- {
diff --git a/debian/patches/myplugin_api.dpatch b/debian/patches/myplugin_api.dpatch
+++ /dev/null
@@ -1,76 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## myplugin_api.dpatch by Sebastian Harl <sh@tokkee.org>
-##
-## DP: Update myplugin.c to the latest collectd API.
-
-@DPATCH@
-
-diff a/contrib/examples/myplugin.c b/contrib/examples/myplugin.c
---- a/contrib/examples/myplugin.c
-+++ b/contrib/examples/myplugin.c
-@@ -100,14 +100,16 @@
- vl.time = time (NULL);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
- sstrncpy (vl.plugin, "myplugin", sizeof (vl.plugin));
-+
-+ /* it is strongly recommended to use a type defined in the types.db file
-+ * instead of a custom type */
-+ sstrncpy (vl.type, "myplugin", sizeof (vl.plugin));
- /* optionally set vl.plugin_instance and vl.type_instance to reasonable
- * values (default: "") */
-
- /* dispatch the values to collectd which passes them on to all registered
-- * write functions - the first argument is used to lookup the data set
-- * definition (it is strongly recommended to use a type defined in the
-- * types.db file) */
-- plugin_dispatch_values ("myplugin", &vl);
-+ * write functions */
-+ plugin_dispatch_values (&vl);
-
- /* A return value != 0 indicates an error and the plugin will be skipped
- * for an increasing amount of time. */
-@@ -117,7 +119,8 @@
- /*
- * This function is called after values have been dispatched to collectd.
- */
--static int my_write (const data_set_t *ds, const value_list_t *vl)
-+static int my_write (const data_set_t *ds, const value_list_t *vl,
-+ user_data_t *ud)
- {
- char name[1024] = "";
- int i = 0;
-@@ -151,7 +154,7 @@
- /*
- * This function is called when plugin_log () has been used.
- */
--static void my_log (int severity, const char *msg)
-+static void my_log (int severity, const char *msg, user_data_t *ud)
- {
- printf ("LOG: %i - %s\n", severity, msg);
- return;
-@@ -160,7 +163,7 @@
- /*
- * This function is called when plugin_dispatch_notification () has been used.
- */
--static int my_notify (const notification_t *notif)
-+static int my_notify (const notification_t *notif, user_data_t *ud)
- {
- char time_str[32] = "";
- struct tm *tm = NULL;
-@@ -210,12 +213,13 @@
- */
- void module_register (void)
- {
-- plugin_register_log ("myplugin", my_log);
-- plugin_register_notification ("myplugin", my_notify);
-+ plugin_register_log ("myplugin", my_log, /* user data */ NULL);
-+ plugin_register_notification ("myplugin", my_notify,
-+ /* user data */ NULL);
- plugin_register_data_set (&ds);
- plugin_register_read ("myplugin", my_read);
- plugin_register_init ("myplugin", my_init);
-- plugin_register_write ("myplugin", my_write);
-+ plugin_register_write ("myplugin", my_write, /* user data */ NULL);
- plugin_register_shutdown ("myplugin", my_shutdown);
- return;
- } /* void module_register (void) */