dhcpcd-discuss

Re: privsep chroot dbdir

Julian Wollrath

Tue Mar 10 11:52:31 2020

Am Tue, 10 Mar 2020 12:40:51 +0100
schrieb Julian Wollrath <julian@xxxxxxxxxxxx>:

> Hi,
> 
> > I have the home folder for the dhcpcd user set as /var/lib/dhcpcd
> > and hence the chroot for lives there. I set '--dbdir=/db' to get it
> > under /var/lib/dhcpcd/db. When I start dhcpcd in a pristine
> > installation /db gets created in addition to /var/lib/dhcpcd/db,
> > while I would expect, that only /var/lib/dhcpcd/db gets created,
> > since this is the only folder which is actually used. With a quick
> > glance, /var/lib/dhcpcd/db gets created by ps_init which should not
> > create /db but maybe there is also another place.  
> 
> there is, probably it should be guarded as follows:
> […]

ähem, missing PRIVSEP before, correctly it should be:

diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index d8c102bb..c4b503a4 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -2028,8 +2028,10 @@ printpidfile:
 		/* Ensure we have the needed directories */
 		if (mkdir(RUNDIR, 0755) == -1 && errno != EEXIST)
 			logerr("%s: mkdir `%s'", __func__, RUNDIR);
+#ifndef PRIVSEP
 		if (mkdir(DBDIR, 0755) == -1 && errno != EEXIST)
 			logerr("%s: mkdir `%s'", __func__, DBDIR);
+#endif
 
 		if ((pid = pidfile_lock(ctx.pidfile)) != 0) {
 			if (pid == -1)



> Cheers,
> Julian
> 
> 



-- 
 ()  ascii ribbon campaign - against html e-mail 
 /\                        - against proprietary attachments

Follow-Ups:
Re: privsep chroot dbdirRoy Marples
References:
privsep chroot dbdirJulian Wollrath
Re: privsep chroot dbdirJulian Wollrath
Archive administrator: postmaster@marples.name