Re: privsep chroot dbdir
Julian Wollrath
Tue Mar 10 11:39:15 2020
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:
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index d8c102bb..ebde559c 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
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
Archive administrator: postmaster@marples.name