summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4434373)
raw | patch | inline | side by side (parent: 4434373)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 28 May 2009 14:28:27 +0000 (16:28 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 28 May 2009 14:31:04 +0000 (16:31 +0200) |
This is an upstream patch to fix the inclusion of empty configuration files,
thanks to Alexander Wirt for reporting this.
thanks to Alexander Wirt for reporting this.
debian/changelog | patch | blob | history | |
debian/patches/00list | patch | blob | history | |
debian/patches/include_empty_files.dpatch | [new file with mode: 0755] | patch | blob |
diff --git a/debian/changelog b/debian/changelog
index 0939ea5481a73b6218711d8c6e3bfd567e997b09..d0a87d3b70e5b454c915b001fbd367cb97324556 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
- Added ntpd_type_pun_fix.dpatch - upstream patch to fix dereferencing of
a type-punned pointer identified by GCC 4.4, thanks to Martin Michlmayr
for reporting this (Closes: #526667).
+ - Added include_empty_files.dpatch - upstream patch to fix the inclusion
+ of empty configuration files, thanks to Alexander Wirt for reporting
+ this.
* debian/collectd.conf, debian/filters.conf:
- Added a sample filter chain configuration.
* debian/rules:
libiptc which is available as shared library since iptables 1.4.3.
Depend on versions >= 1.4.3.2-2 because of #524766.
- -- Sebastian Harl <sh@tokkee.org> Tue, 05 May 2009 22:59:33 +0200
+ -- Sebastian Harl <sh@tokkee.org> Thu, 28 May 2009 16:23:01 +0200
collectd (4.6.2-1) unstable; urgency=low
diff --git a/debian/patches/00list b/debian/patches/00list
index 63040b338196c0e14bdfa7307954242a9d4bae05..1a38c72d142aab8765839b08d573667c61486fa1 100644 (file)
--- a/debian/patches/00list
+++ b/debian/patches/00list
collection_conf_path.dpatch
battery_acpi_complain.dpatch
ntpd_type_pun_fix.dpatch
+include_empty_files.dpatch
diff --git a/debian/patches/include_empty_files.dpatch b/debian/patches/include_empty_files.dpatch
--- /dev/null
@@ -0,0 +1,54 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## include_empty_files.dpatch by Sebastian Harl <sh@tokkee.org>
+##
+## DP: configfile.c: Fixed Include'ing empty files.
+## DP:
+## DP: When including empty files, a typo prevented that the "Include" child
+## DP: (of the config parse tree) was removed correctly, leaving behind
+## DP: garbage which in turn led to a segfault if the Include option was not
+## DP: the last element of the config file.
+## DP:
+## DP: Also, another Include option following the inclusion of an empty file
+## DP: used to be ignored. This has been fixed as well.
+
+@DPATCH@
+
+diff a/src/configfile.c b/src/configfile.c
+--- a/src/configfile.c
++++ b/src/configfile.c
+@@ -378,12 +378,12 @@ static int cf_ci_replace_child (oconfig_item_t *dst, oconfig_item_t *src,
+ temp = NULL;
+
+ /* If (src->children_num == 0) the array size is decreased. If offset
+- * is _not_ the last element, (offset < (src->children_num - 1)), then
++ * is _not_ the last element, (offset < (dst->children_num - 1)), then
+ * we need to move the trailing elements before resizing the array. */
+- if ((src->children_num == 0) && (offset < (src->children_num - 1)))
++ if ((src->children_num == 0) && (offset < (dst->children_num - 1)))
+ {
+- int nmemb = src->children_num - (offset + 1);
+- memmove (src->children + offset, src->children + offset + 1,
++ int nmemb = dst->children_num - (offset + 1);
++ memmove (dst->children + offset, dst->children + offset + 1,
+ sizeof (oconfig_item_t) * nmemb);
+ }
+
+@@ -415,7 +415,7 @@ static int cf_ci_replace_child (oconfig_item_t *dst, oconfig_item_t *src,
+ sizeof (oconfig_item_t) * nmemb);
+ }
+
+- /* Last but not least: If there are new childrem, copy them to the
++ /* Last but not least: If there are new children, copy them to the
+ * memory reserved for them. */
+ if (src->children_num > 0)
+ {
+@@ -491,6 +491,9 @@ static int cf_include_all (oconfig_item_t *root, int depth)
+ /* Now replace the i'th child in `root' with `new'. */
+ cf_ci_replace_child (root, new, i);
+
++ /* ... and go back to the new i'th child. */
++ --i;
++
+ sfree (new->values);
+ sfree (new);
+ } /* for (i = 0; i < root->children_num; i++) */