From 73c5b5e7c431d2a8fd22597201c9da600aaf1f2c Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 9 Apr 2021 11:51:19 +0200 Subject: [PATCH] priv: fix chroot directory creation The last component was not created! --- NEWS | 4 ++++ src/daemon/priv.c | 2 ++ 2 files changed, 6 insertions(+) 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; -- 2.39.5