summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5ed0913)
raw | patch | inline | side by side (parent: 5ed0913)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 27 Aug 2009 21:44:54 +0000 (23:44 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 27 Aug 2009 21:44:54 +0000 (23:44 +0200) |
This is an upstream patch fixing the handling of the LocalSocket config option
of the powerdns plugin.
Thanks to Thomas Morgan for reporting this and Luke Heberling for providing a
patch.
References: #535787
of the powerdns plugin.
Thanks to Thomas Morgan for reporting this and Luke Heberling for providing a
patch.
References: #535787
debian/changelog | patch | blob | history | |
debian/patches/00list | patch | blob | history | |
debian/patches/bts535787-powerdns-fix-localsocket.dpatch | [new file with mode: 0755] | patch | blob |
diff --git a/debian/changelog b/debian/changelog
index 8ac3a6b647913a730bd37fb8cecd8b975302d748..e6d693689a0c40da0d44621c9104a51d12d46283 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
- Added curl-followlocation.dpatch - upstream patch to let plugins using
libcurl follow HTTP redirects; thanks to Joey Hess for reporting this
(Closes: #541953).
+ - Added bts535787-powerdns-fix-localsocket.dpatch - upstream patch fixing
+ the handling of the LocalSocket config option of the powerdns plugin;
+ thanks to Thomas Morgan for reporting this and Luke Heberling for
+ providing a patch (references: #535787).
* debian/README.Debian:
- Removed the note about how to get collectd2html.pl working with
version 4 of collectd - the script now supports the --recursive option
- Set the 'apache' plugin's URL according to the default used by Debian's
Apache; thanks to Joey Hess for reporting this (Closes: #541888).
- -- Sebastian Harl <tokkee@debian.org> Thu, 27 Aug 2009 23:29:41 +0200
+ -- Sebastian Harl <tokkee@debian.org> Thu, 27 Aug 2009 23:41:50 +0200
collectd (4.6.3-1) unstable; urgency=low
diff --git a/debian/patches/00list b/debian/patches/00list
index cdf98cff912446092f8ec992642873545ad2c8a8..06e05c44fd1cb213ff78287bf0d3babd36ea0d1f 100644 (file)
--- a/debian/patches/00list
+++ b/debian/patches/00list
plugin-fix-unregister.dpatch
java-fix-jvm-start.dpatch
curl-followlocation.dpatch
+bts535787-powerdns-fix-localsocket.dpatch
diff --git a/debian/patches/bts535787-powerdns-fix-localsocket.dpatch b/debian/patches/bts535787-powerdns-fix-localsocket.dpatch
--- /dev/null
@@ -0,0 +1,54 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts535787-powerdns-fix-localsocket.dpatch by Luke Heberling
+## <collectd@c-ware.com>
+##
+## DP: powerdns plugin: Fixed handling of the LocalSocket option.
+
+@DPATCH@
+
+diff a/src/powerdns.c b/src/powerdns.c
+--- a/src/powerdns.c
++++ b/src/powerdns.c
+@@ -380,6 +380,18 @@ static int powerdns_get_data_dgram (list_item_t *item, /* {{{ */
+ break;
+ }
+
++ struct timeval timeout;
++ timeout.tv_sec=2;
++ if (timeout.tv_sec < interval_g * 3 / 4)
++ timeout.tv_sec = interval_g * 3 / 4;
++ timeout.tv_usec=0;
++ status = setsockopt (sd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof (timeout));
++ if (status != 0)
++ {
++ FUNC_ERROR ("setsockopt");
++ break;
++ }
++
+ status = connect (sd, (struct sockaddr *) &item->sockaddr,
+ sizeof (item->sockaddr));
+ if (status != 0)
+@@ -911,11 +923,18 @@ static int powerdns_config (oconfig_item_t *ci) /* {{{ */
+ powerdns_config_add_server (option);
+ else if (strcasecmp ("LocalSocket", option->key) == 0)
+ {
+- char *temp = strdup (option->key);
+- if (temp == NULL)
+- return (1);
+- sfree (local_sockpath);
+- local_sockpath = temp;
++ if ((option->values_num != 1) || (option->values[0].type != OCONFIG_TYPE_STRING))
++ {
++ WARNING ("powerdns plugin: `%s' needs exactly one string argument.", option->key);
++ }
++ else
++ {
++ char *temp = strdup (option->values[0].value.string);
++ if (temp == NULL)
++ return (1);
++ sfree (local_sockpath);
++ local_sockpath = temp;
++ }
+ }
+ else
+ {