From: Roy Marples Date: Fri, 3 Jul 2020 10:30:25 +0000 (+0100) Subject: dhcpcd: Fix creating DBDIR X-Git-Tag: v9.1.4~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=342d6249a2d16099b15ad5932150a104d40a68db;p=thirdparty%2Fdhcpcd.git dhcpcd: Fix creating DBDIR As privsep now uses files in / and not the dhcpcd users directory we need to ensure the mkdir is back with the rundir. --- diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 2bed8e04..8c4b95e2 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -2186,6 +2186,8 @@ printpidfile: if (!(ctx.options & DHCPCD_TEST)) { /* Ensure we have the needed directories */ + if (mkdir(DBDIR, 0755) == -1 && errno != EEXIST) + logerr("%s: mkdir `%s'", __func__, DBDIR); if (mkdir(RUNDIR, 0755) == -1 && errno != EEXIST) logerr("%s: mkdir `%s'", __func__, RUNDIR); if ((pid = pidfile_lock(ctx.pidfile)) != 0) { @@ -2284,13 +2286,6 @@ printpidfile: } } - /* If we're not running in privsep, we need to create the DB - * directory here. */ - if (!(ctx.options & DHCPCD_PRIVSEP)) { - if (mkdir(DBDIR, 0755) == -1 && errno != EEXIST) - logerr("%s: mkdir `%s'", __func__, DBDIR); - } - #ifdef PRIVSEP if (IN_PRIVSEP(&ctx) && ps_start(&ctx) == -1) { logerr("ps_start");