From 6994882bb63aa1e943e1ccf55b1d3619fe533030 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 9 Jan 2012 19:20:10 +0100 Subject: [PATCH] patches: Added bts619123_mkdir_endless_loop_fix. The patch fixes an endless loop in case the datadir is a symlink pointing to a non-existent target. Thanks to Michael Prokop for reporting this and Jonathan Nieder for providing the patch. Closes: #619123 --- debian/changelog | 10 +++++++ .../bts619123_mkdir_endless_loop_fix.dpatch | 28 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 debian/patches/bts619123_mkdir_endless_loop_fix.dpatch diff --git a/debian/changelog b/debian/changelog index f3b1996..db2e51e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +collectd (4.10.4-2) unstable; urgency=low + + * debian/patches/: + - Added bts619123_mkdir_endless_loop_fix, fixing an endless loop in case + the datadir is a symlink pointing to a non-existent target; thanks to + Michael Prokop for reporting this and Jonathan Nieder for providing the + patch (Closes: #619123). + + -- Sebastian Harl Mon, 09 Jan 2012 19:17:32 +0100 + collectd (4.10.4-1) unstable; urgency=low * New upstream release. diff --git a/debian/patches/bts619123_mkdir_endless_loop_fix.dpatch b/debian/patches/bts619123_mkdir_endless_loop_fix.dpatch new file mode 100755 index 0000000..eaddb9f --- /dev/null +++ b/debian/patches/bts619123_mkdir_endless_loop_fix.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## bts619123_mkdir_endless_loop_fix.dpatch by Jonathan Nieder +## +## +## DP: common: check_create_dir(): Support symlinks as well. +## DP: +## DP: Previously, the following situation would cause an endless loop (as +## DP: reported by Michael Prokop in Debian bug #619123): the (CSV or RRD) +## DP: datadir is a symlink pointing to a non-existent target. +## DP: +## DP: With this patch applied, check_create_dir() fails with " exists +## DP: but is not a directory". + +@DPATCH@ + +diff a/src/common.c b/src/common.c +--- a/src/common.c ++++ b/src/common.c +@@ -542,7 +542,8 @@ int check_create_dir (const char *file_orig) + } + + while (42) { +- if (stat (dir, &statbuf) == -1) ++ if ((stat (dir, &statbuf) == -1) ++ && (lstat (dir, &statbuf) == -1)) + { + if (errno == ENOENT) + { -- 2.30.2