Build dhcpcd with privsep support.

This commit is contained in:
roy 2020-04-02 12:56:01 +00:00
parent 4982964f6e
commit cdef9ff213
3 changed files with 16 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.3 2018/07/05 05:41:17 triaxx Exp $
# $NetBSD: Makefile.inc,v 1.4 2020/04/02 12:56:01 roy Exp $
SRCDIR= ${NETBSDSRCDIR}/external/bsd/dhcpcd
DIST= ${SRCDIR}/dist
@ -7,10 +7,11 @@ SED_SYS= -e 's:@SYSCONFDIR@:/etc:g' \
-e 's:@DATADIR@:/usr/share/examples:g' \
-e 's:@DBDIR@:/var/db/dhcpcd:g' \
-e 's:@LIBDIR@:/lib:g' \
-e 's:@RUNDIR@:/var/run:g' \
-e 's:@RUNDIR@:/var/run/dhcpcd:g' \
-e 's:@HOOKDIR@:/libexec/dhcpcd-hooks:g' \
-e 's:@SCRIPT@:/libexec/dhcpcd-run-hooks:g' \
-e 's:@SERVICEEXISTS@::g' \
-e 's:@SERVICECMD@::g' \
-e 's:@SERVICESTATUS@::g' \
-e 's:@STATUSARG@::g'
-e 's:@STATUSARG@::g' \
-e 's:@DEFAULT_HOSTNAME@::g'

View File

@ -1,16 +1,20 @@
/* netbsd */
#ifndef SYSCONFDIR
#define SYSCONFDIR "/etc"
#define SBINDIR "/sbin"
#define LIBDIR "/lib"
#define LIBEXECDIR "/libexec"
#define DBDIR "/var/db/dhcpcd"
#define RUNDIR "/var/run"
#define RUNDIR "/var/run/dhcpcd"
#endif
#ifndef PRIVSEP_USER
#define PRIVSEP_USER "_dhcpcd"
#endif
#define HAVE_IFAM_PID
#define HAVE_IFAM_ADDRFLAGS
#define HAVE_IFADDRS_ADDRFLAGS
#define HAVE_OPEN_MEMSTREAM
#define HAVE_UTIL_H
#define HAVE_SETPROCTITLE
#define HAVE_SYS_QUEUE_H
#define HAVE_SYS_RBTREE_H
#define HAVE_REALLOCARRAY

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.50 2020/01/29 23:42:57 christos Exp $
# $NetBSD: Makefile,v 1.51 2020/04/02 12:56:01 roy Exp $
#
WARNS?= 6
@ -13,6 +13,10 @@ SRCS+= if.c if-options.c route.c sa.c script.c
SRCS+= dhcp-common.c dhcpcd-embedded.c
SRCS+= if-bsd.c
CPPFLAGS+= -DPRIVSEP -DPRIVSEP_USER=\"_dhcpcd\"
SRCS+= privsep.c privsep-root.c privsep-inet.c
SRCS+= privsep-bsd.c
CPPFLAGS+= -DHAVE_CONFIG_H -D_OPENBSD_SOURCE
USE_INET?= yes
@ -27,6 +31,7 @@ SRCS+= auth.c
.if (${USE_INET} != "no")
CPPFLAGS+= -DINET
SRCS+= bpf.c dhcp.c ipv4.c
SRCS+= privsep-bpf.c
.if !defined(SMALLPROG)
CPPFLAGS+= -DARP
SRCS+= arp.c