We continue if the privsep user cannot be found, so do the same
if passwd or similar is missing from the system.
This helps people who use dhcpcd in ramdisks to oneshot the config
for example to start iSCSI.
freopen(_PATH_DEVNULL, "r", stdin);
#ifdef PRIVSEP
- if (ps_init(&ctx) == -1) {
- if (errno != 0) {
- logerr("ps_init");
- goto exit_failure;
- }
- } else
+ if (ps_init(&ctx) == 0)
script_runchroot(&ctx, ifo->script);
#endif
/* If we pickup the _dhcp user refuse the default directory */
if (strcmp(pw->pw_dir, "/var/empty") == 0) {
+ ctx->options &= ~DHCPCD_PRIVSEP;
logerrx("refusing chroot: %s: %s", PRIVSEP_USER, pw->pw_dir);
errno = 0;
return -1;