dhcpcd-discuss

Re: Packaging dhcpcd for privsep

Roy Marples

Fri Apr 10 13:38:11 2020

On 10/04/2020 10:23, Roy Marples wrote:
On 10/04/2020 01:50, Ben Woods wrote:
 3. Given the _dhcp user on FreeBSD has its home directory set to /var/empty,
    what is required to correctly setup chroot?

It needs to be elsewhere because more that _dhcp uses /var/emtpy - and it's silly to fill something called empty with files!
So either change it or create a new user.

I'm starting to thing that by default, the dhcpcd package should use _dhcpcd by default and create that user rather than changing the home directory of _dhcp.
That's why I've not updated pkgsrc for dhcpcd-9 yet.
But after this discussion I think dropping the auto detection of _dhcp is the right thing to do as a *package*.

As such I've made this commit:
https://roy.marples.name/cgit/dhcpcd.git/commit/?id=36c47a8df0951236a7842bbf8241e2932357ef61

cc'ing Stuart as he maintains the OpenBSD port and I'd like both your thoughts on this.

I've made some more changes to the configure script - it will detect users in this order: _dhcpcd _dhcp dhcpcd. If any has a home directory not /var/empty then dhcpcd will use that user by default. If no such user is found then dhcpcd will default to the dhcpcd user (no leading underscore).

This should allow the dhcpcd package to add the dhcpcd user with a working home directory without the need to interfere with system users.

Note this is just the default... packagers can specify whatever user they wish to use still by the --privsepuser=whatever

Roy

References:
Packaging dhcpcd for privsepBen Woods
Re: Packaging dhcpcd for privsepRoy Marples
Archive administrator: postmaster@marples.name