From 6344e5a62de979bed8c85e5fd9c95549b38e663c Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 8 Sep 2010 22:26:31 +0200 Subject: [PATCH] patches: Added bts592623-curl_json-file. This is an upstream patch fixing access to file:// URLs in the 'curl_json' plugin. Thanks Baptiste Mille-Mathias for reporting this and pointing out the patch! Closes: #592623 --- debian/changelog | 5 ++++- debian/patches/00list | 1 + .../patches/bts592623-curl_json-file.dpatch | 22 +++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 debian/patches/bts592623-curl_json-file.dpatch diff --git a/debian/changelog b/debian/changelog index 6a55b30..c220dd8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,11 @@ collectd (4.10.1-2) unstable; urgency=low - Added bts595756-notify_email-segfault -- upstream patch fixing a segfault in the 'notify_email' plugin; thanks to Manuel CISSE for reporting this (Closes: #595756). + - Added bts592623-curl_json-file -- upstream patch fixing access to + file:// URLs in the 'curl_json' plugin; thanks Baptiste Mille-Mathias + for reporting this and pointing out the patch (Closes: #592623). - -- Sebastian Harl Wed, 08 Sep 2010 22:12:56 +0200 + -- Sebastian Harl Wed, 08 Sep 2010 22:25:05 +0200 collectd (4.10.1-1) unstable; urgency=low diff --git a/debian/patches/00list b/debian/patches/00list index f781a02..e186cd0 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -2,4 +2,5 @@ rrd_filter_path.dpatch collection_conf_path.dpatch bts559801_plugin_find_fix.dpatch bts595756-notify_email-segfault.dpatch +bts592623-curl_json-file.dpatch diff --git a/debian/patches/bts592623-curl_json-file.dpatch b/debian/patches/bts592623-curl_json-file.dpatch new file mode 100755 index 0000000..d143bc8 --- /dev/null +++ b/debian/patches/bts592623-curl_json-file.dpatch @@ -0,0 +1,22 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## bts592623-curl_json-file.dpatch by Florian Forster +## +## DP: curl json: Fix checking the response code. +## DP: +## DP: This fixes access to file:// URLs. + +@DPATCH@ + +diff a/src/curl_json.c b/src/curl_json.c +--- a/src/curl_json.c ++++ b/src/curl_json.c +@@ -775,7 +775,8 @@ static int cj_curl_perform (cj_t *db, CURL *curl) /* {{{ */ + curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url); + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &rc); + +- if (rc != 200) ++ /* The response code is zero if a non-HTTP transport was used. */ ++ if ((rc != 0) && (rc != 200)) + { + ERROR ("curl_json plugin: curl_easy_perform failed with response code %ld (%s)", + rc, url); -- 2.30.2