From: Vincent Bernat Date: Mon, 10 Dec 2018 13:54:22 +0000 (+0100) Subject: daemon: fix creation of chroot directory X-Git-Tag: 1.0.3~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22bd96c5ada0f657d4a4f2829980babee58bae11;p=thirdparty%2Flldpd.git daemon: fix creation of chroot directory Because the current path was uninitialized, we were creating semi-random directory at the root of the filesystem. --- diff --git a/NEWS b/NEWS index fdd7b1da..cd606215 100644 --- 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 diff --git a/src/daemon/priv.c b/src/daemon/priv.c index bf9fb550..f4d6bdf4 100644 --- a/src/daemon/priv.c +++ b/src/daemon/priv.c @@ -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)) {