summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bfe578e)
raw | patch | inline | side by side (parent: bfe578e)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 9 Jan 2012 18:20:10 +0000 (19:20 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 9 Jan 2012 18:20:10 +0000 (19:20 +0100) |
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
non-existent target.
Thanks to Michael Prokop for reporting this and Jonathan Nieder for providing
the patch.
Closes: #619123
debian/changelog | patch | blob | history | |
debian/patches/bts619123_mkdir_endless_loop_fix.dpatch | [new file with mode: 0755] | patch | blob |
diff --git a/debian/changelog b/debian/changelog
index f3b199690985dc684cbb3df8b7fdfee9850619c9..db2e51e6390305e9759510cd8ec64de48f696db8 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
+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 <tokkee@debian.org> 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
--- /dev/null
@@ -0,0 +1,28 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts619123_mkdir_endless_loop_fix.dpatch by Jonathan Nieder
+## <jrnieder@gmail.com>
+##
+## 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 "<file> 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)
+ {