From: Vincent Bernat Date: Fri, 9 Apr 2021 09:51:19 +0000 (+0200) Subject: priv: fix chroot directory creation X-Git-Tag: 1.0.10~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=73c5b5e7c431d2a8fd22597201c9da600aaf1f2c;p=thirdparty%2Flldpd.git priv: fix chroot directory creation The last component was not created! --- diff --git a/NEWS b/NEWS index efcf9fa2..addd8317 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +lldpd (1.0.10) + * Fix: + + Fix chroot directory creation. + lldpd (1.0.9) * Fix: + Do not use interface alias if we set it ourselves. diff --git a/src/daemon/priv.c b/src/daemon/priv.c index e4ae6eca..a1a0bf95 100644 --- a/src/daemon/priv.c +++ b/src/daemon/priv.c @@ -537,6 +537,8 @@ static int mkdir_p(const char *pathname, mode_t mode) return -1; *current = '/'; } + if (mkdir(path, mode) != 0 && errno != EEXIST) + return -1; errno = 0; return 0;