From: Sebastian Harl Date: Sun, 23 Nov 2014 12:27:06 +0000 (+0100) Subject: patches: Added bts747093_lvm_segfault. X-Git-Tag: collectd-5.4.1-6~12 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6264cf43c86d2e9c243008d02e69c02c57a8b0f6;p=pkg-collectd.git patches: Added bts747093_lvm_segfault. Upstream fix for a segfault in the LVM plugin. Thanks to Bernd Zeimetz and Marc Fournier for reporting this. Closes: #747093 --- diff --git a/debian/changelog b/debian/changelog index eb58e13..f192cfe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ collectd (5.4.1-6) UNRELEASED; urgency=medium - Added bts770681_riemann_ack: upstream fix for the write_riemann plugin to avoid locking up a remote Riemann instance; thanks to Marc Fournier for reporting this (Closes: #770681). + - Added bts747093_lvm_segfault: upstream fix for a segfault in the LVM + plugin; thanks to Bernd Zeimetz and Marc Fournier for reporting this + (Closes: #747093). -- Sebastian Harl Sun, 23 Nov 2014 13:04:03 +0100 diff --git a/debian/patches/00list b/debian/patches/00list index 78e7f2d..f1f07e7 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -5,3 +5,4 @@ myplugin_includes.dpatch myplugin_api.dpatch bts559801_plugin_find_fix.dpatch bts770681_riemann_ack.dpatch +bts747093_lvm_segfault.dpatch diff --git a/debian/patches/bts747093_lvm_segfault.dpatch b/debian/patches/bts747093_lvm_segfault.dpatch new file mode 100755 index 0000000..d9b9650 --- /dev/null +++ b/debian/patches/bts747093_lvm_segfault.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## +## DP: bts747093_lvm_segfault.dpatch by Jan Kundrát +## DP: +## DP: lvm: Fix segfault when there are no logical volumes. +## DP: +## DP: Upstream bug report: +## DP: https://github.com/collectd/collectd/pull/425 + +@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)); + }