]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
daemon: fix creation of chroot directory
authorVincent Bernat <vincent@bernat.ch>
Mon, 10 Dec 2018 13:54:22 +0000 (14:54 +0100)
committerVincent Bernat <vincent@bernat.ch>
Mon, 10 Dec 2018 13:54:22 +0000 (14:54 +0100)
Because the current path was uninitialized, we were creating
semi-random directory at the root of the filesystem.

NEWS
src/daemon/priv.c

diff --git a/NEWS b/NEWS
index fdd7b1da25fc54f3c1fc9b2e6fbe0e4aef4720f9..cd6062155cda35ddebb15f72b1da2877e132001f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+lldpd (1.0.3)
+  * Fix:
+    + Fix creation of chroot directory.
+
 lldpd (1.0.2)
   * Changes:
     + On Linux, the monitor process will now drop its privileges
index bf9fb550fb0dd634ce43e044056f3a8ea1f08bda..f4d6bdf4fcc765cd65ed007854831ca2db9c277a 100644 (file)
@@ -513,7 +513,7 @@ sig_chld(int sig)
 /* Create a directory recursively. */
 static int mkdir_p(const char *pathname, mode_t mode)
 {
-       char path[PATH_MAX+1], current[PATH_MAX+1];
+       char path[PATH_MAX+1], current[PATH_MAX+1] = {};
        char *tok;
 
        if (strlcpy(path, pathname, sizeof(path)) >= sizeof(path)) {