summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2016-10-13 22:48:26 +0200
committerThomas Deutschmann <whissi@gentoo.org>2016-10-13 22:48:52 +0200
commit180eeb25679dbf994da5571521187938e8ec8354 (patch)
tree810a9e32d114941ae30014b60e9c7e8d04636b29 /app-admin/collectd/files
parentapp-office/libreoffice-bin: move hunspell to BIN_COMMON_DEPEND (diff)
downloadgentoo-180eeb25679dbf994da5571521187938e8ec8354.tar.gz
gentoo-180eeb25679dbf994da5571521187938e8ec8354.tar.bz2
gentoo-180eeb25679dbf994da5571521187938e8ec8354.zip
app-admin/collectd: Revision bump to address multiple issues
- When collectd was emerged with "filecaps" USE flag set and at least one chosen plugin required special capabilities systemd was unable to start collectd because CapabilityBoundingSet option in collectd's systemd unit file did not match with the capabilities actual set for "/usr/sbin/collectd". (bug #596852) - Cherry picked upstream commit 5e4f2ae61d to get rid of > capability: warning: `collectd' uses 32-bit capabilities (legacy support in use) message. Gentoo-Bug: https://bugs.gentoo.org/596852 Package-Manager: portage-2.3.2
Diffstat (limited to 'app-admin/collectd/files')
-rw-r--r--app-admin/collectd/files/collectd-5.6.0-fix-apache-plugin.patch26
-rw-r--r--app-admin/collectd/files/collectd-5.6.0-issue-1896.patch76
-rw-r--r--app-admin/collectd/files/collectd-5.6.0-use-_LINUX_CAPABILITY_VERSION_3.patch37
3 files changed, 37 insertions, 102 deletions
diff --git a/app-admin/collectd/files/collectd-5.6.0-fix-apache-plugin.patch b/app-admin/collectd/files/collectd-5.6.0-fix-apache-plugin.patch
deleted file mode 100644
index e3afaeb5d607..000000000000
--- a/app-admin/collectd/files/collectd-5.6.0-fix-apache-plugin.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 60ec28dd104bdeef4c5ed6882fb2b663ca9da2eb Mon Sep 17 00:00:00 2001
-From: Florian Forster <octo@collectd.org>
-Date: Sun, 11 Sep 2016 20:31:31 +0200
-Subject: [PATCH] apache plugin: End statements with semi-colons.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-If only I knew why this wasn't considered a syntax error …
----
- src/apache.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/apache.c b/src/apache.c
-index c515e3c..5b6914c 100644
---- a/src/apache.c
-+++ b/src/apache.c
-@@ -250,7 +250,7 @@ static int config_add (oconfig_item_t *ci)
- ssnprintf (callback_name, sizeof (callback_name),
- "apache/%s/%s",
- (st->host != NULL) ? st->host : hostname_g,
-- (st->name != NULL) ? st->name : "default"),
-+ (st->name != NULL) ? st->name : "default");
-
- status = plugin_register_complex_read (/* group = */ NULL,
- /* name = */ callback_name,
diff --git a/app-admin/collectd/files/collectd-5.6.0-issue-1896.patch b/app-admin/collectd/files/collectd-5.6.0-issue-1896.patch
deleted file mode 100644
index afcd8d0a1bbb..000000000000
--- a/app-admin/collectd/files/collectd-5.6.0-issue-1896.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From ba52f94929822b1968f05cfbb37985af2e0b83a4 Mon Sep 17 00:00:00 2001
-From: Florian Forster <octo@collectd.org>
-Date: Tue, 13 Sep 2016 10:44:46 +0200
-Subject: [PATCH] curl_json plugin: Skip unexpected non-map values.
-
-Assume, for example, the config `Key "*/foo"`. This config expects JSON
-in the form:
-
- {
- "bar": {
- "foo": 1337
- }
- }
-
-If the available JSON is instead:
-
- {
- "error_code": 0,
- "bar": {
- "foo": 1337
- }
- }
-
-the code will take a look at the zero associated with "error_code" and
-determine that a map (with key "foo") is expected instead. Previously
-the code would continue, eventually calling `cj_get_type()` which
-expects that `key->type` is a valid pointer, resulting in a segmentation
-fault.
-
-This patch does three things to ensure that this segmentation fault does
-not happen again:
-
-1. `cj_get_type()` checks its argument to make sure it is valid before
- dereferencing any pointers.
-2. In case a non-map is found when a map is expected, the code will
- return instead of limping on.
-3. After calling `cj_cb_inc_array_index()`, which may update the key,
- make sure that it actually did and that key is valid now.
-
-Fixes: #1896
----
- src/curl_json.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/src/curl_json.c b/src/curl_json.c
-index 4188f37..a547ddc 100644
---- a/src/curl_json.c
-+++ b/src/curl_json.c
-@@ -143,6 +143,9 @@ static int cj_get_type (cj_key_t *key)
- {
- const data_set_t *ds;
-
-+ if ((key == NULL) || !CJ_IS_KEY (key))
-+ return -EINVAL;
-+
- ds = plugin_get_ds (key->type);
- if (ds == NULL)
- {
-@@ -226,12 +229,15 @@ static int cj_cb_number (void *ctx,
- buffer[sizeof (buffer) - 1] = 0;
-
- if ((key == NULL) || !CJ_IS_KEY (key)) {
-- if (key != NULL && !db->state[db->depth].in_array/*can be inhomogeneous*/)
-+ if (key != NULL && !db->state[db->depth].in_array/*can be inhomogeneous*/) {
- NOTICE ("curl_json plugin: Found \"%s\", but the configuration expects"
- " a map.", buffer);
-+ return (CJ_CB_CONTINUE);
-+ }
-+
- cj_cb_inc_array_index (ctx, /* update_key = */ 1);
- key = db->state[db->depth].key;
-- if (key == NULL) {
-+ if ((key == NULL) || !CJ_IS_KEY (key)) {
- return (CJ_CB_CONTINUE);
- }
- }
diff --git a/app-admin/collectd/files/collectd-5.6.0-use-_LINUX_CAPABILITY_VERSION_3.patch b/app-admin/collectd/files/collectd-5.6.0-use-_LINUX_CAPABILITY_VERSION_3.patch
new file mode 100644
index 000000000000..6c7e63501825
--- /dev/null
+++ b/app-admin/collectd/files/collectd-5.6.0-use-_LINUX_CAPABILITY_VERSION_3.patch
@@ -0,0 +1,37 @@
+From 5e4f2ae61dc39938c4df857854724ba1d36f3232 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi@gentoo.org>
+Date: Tue, 11 Oct 2016 16:16:23 +0200
+Subject: [PATCH] common.c: Use _LINUX_CAPABILITY_VERSION_3 in cap_header
+
+While check_capability() function already requires
+_LINUX_CAPABILITY_VERSION_3 via "#ifdef" since commit 448627953c we still
+set the cap_header's version to deprecated _LINUX_CAPABILITY_VERSION. This
+results in a warning like
+
+ > capability: warning: `collectd' uses 32-bit capabilities (legacy support in use)
+
+from the kernel when a plugin (like iptables) calls our check_capability()
+function.
+
+With this commit we will set cap_header to kernel's current capability
+version (_LINUX_CAPABILITY_VERSION_3), which is default since
+kernel 2.6.26.
+
+Signed-off-by: Florian Forster <octo@collectd.org>
+---
+ src/daemon/common.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/daemon/common.c b/src/daemon/common.c
+index e489449..477d759 100644
+--- a/src/daemon/common.c
++++ b/src/daemon/common.c
+@@ -1698,7 +1698,7 @@ int check_capability (int capability) /* {{{ */
+ }
+
+ cap_header->pid = getpid();
+- cap_header->version = _LINUX_CAPABILITY_VERSION;
++ cap_header->version = _LINUX_CAPABILITY_VERSION_3;
+ if (capget(cap_header, cap_data) < 0)
+ {
+ ERROR("check_capability: capget failed");