if (if_opensockets_os(ctx) == -1)
return -1;
-#ifdef PF_LINK
+#ifdef IFLR_ACTIVE
ctx->pf_link_fd = xsocket(PF_LINK, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (ctx->pf_link_fd == -1)
return -1;
ps_dropprivs(struct dhcpcd_ctx *ctx)
{
struct passwd *pw = ctx->ps_user;
+#ifndef HAVE_PLEDGE
struct rlimit rzero = { .rlim_cur = 0, .rlim_max = 0 };
+#endif
if (!(ctx->options & DHCPCD_FORKED))
logdebugx("chrooting to `%s' as %s", pw->pw_dir, pw->pw_name);
return -1;
}
+#ifndef HAVE_PLEDGE
/* Prohibit new files, sockets, etc */
if (setrlimit(RLIMIT_NOFILE, &rzero) == -1) {
logerr("setrlimit RLIMIT_NOFILE");
logerr("setrlimit RLIMIT_NPROC");
return -1;
}
+#endif
#endif
return 0;