summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d9b2787)
raw | patch | inline | side by side (parent: d9b2787)
author | Sebastian Harl <sh@teamix.net> | |
Wed, 1 Aug 2012 08:24:52 +0000 (10:24 +0200) | ||
committer | Sebastian Harl <sh@teamix.net> | |
Wed, 1 Aug 2012 08:24:52 +0000 (10:24 +0200) |
Fixed segfault in rrdcached when starting without having the journal directory
available: canonicalize the journal path after creating the directory; else,
realpath(3) will return NULL causing strdup() to segfault. Also, check the
return value of realpath(3) before further using it.
Thanks to Helmut Grohne for reporting this.
Closes: #664724
available: canonicalize the journal path after creating the directory; else,
realpath(3) will return NULL causing strdup() to segfault. Also, check the
return value of realpath(3) before further using it.
Thanks to Helmut Grohne for reporting this.
Closes: #664724
debian/changelog | patch | blob | history | |
debian/patches/bts664724-rrdcached-j-segfault | [new file with mode: 0644] | patch | blob |
debian/patches/series | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
index 8dfd223aecaec904b12c472bdbda4b0c73ccfd7a..513811e846aa58bf1cd53c710cc1e6fe8feb40be 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
+rrdtool (1.4.7-2) unstable; urgency=low
+
+ * Ack NMUs; thanks to Jonathan Wiltshire and gregor herrmann!
+ * Added debian/patches/bts664724-rrdcached-j-segfault:
+ Fixed segfault in rrdcached when starting without having the journal
+ directory available: canonicalize the journal path after creating the
+ directory; else, realpath(3) will return NULL causing strdup() to
+ segfault. Also, check the return value of realpath(3) before further using
+ it. Thanks to Helmut Grohne for reporting this (Closes: #664724).
+
+ -- Sebastian Harl <tokkee@debian.org> Wed, 01 Aug 2012 10:23:39 +0200
+
rrdtool (1.4.7-1.2) unstable; urgency=low
* Non-maintainer upload.
diff --git a/debian/patches/bts664724-rrdcached-j-segfault b/debian/patches/bts664724-rrdcached-j-segfault
--- /dev/null
@@ -0,0 +1,31 @@
+diff a/src/rrd_daemon.c b/src/rrd_daemon.c
+--- a/src/rrd_daemon.c
++++ b/src/rrd_daemon.c
+@@ -3090,8 +3090,7 @@ static int read_options (int argc, char **argv) /* {{{ */
+ case 'j':
+ {
+ char journal_dir_actual[PATH_MAX];
+- const char *dir;
+- dir = journal_dir = strdup(realpath((const char *)optarg, journal_dir_actual));
++ const char *dir = (const char *)optarg;
+
+ status = rrd_mkdir_p(dir, 0777);
+ if (status != 0)
+@@ -3100,8 +3099,16 @@ static int read_options (int argc, char **argv) /* {{{ */
+ dir, rrd_strerror(errno));
+ return 6;
+ }
++ journal_dir = realpath((const char *)dir, journal_dir_actual);
++ if (! journal_dir) {
++ fprintf(stderr, "Failed to canonicalize journal directory '%s': %s\n",
++ dir, rrd_strerror(errno));
++ return 6;
++ }
++
++ journal_dir = strdup(journal_dir);
+
+- if (access(dir, R_OK|W_OK|X_OK) != 0)
++ if (access(journal_dir, R_OK|W_OK|X_OK) != 0)
+ {
+ fprintf(stderr, "Must specify a writable directory with -j! (%s)\n",
+ errno ? rrd_strerror(errno) : "");
diff --git a/debian/patches/series b/debian/patches/series
index 863055e9878aedd659b2921635b20a76e307d380..76fd6d3aa26f1227b112a9e593b895633a5e9e45 100644 (file)
--- a/debian/patches/series
+++ b/debian/patches/series
bts530814-hurd
tcl-8.5
ruby_bindings_format_string.patch
+bts664724-rrdcached-j-segfault