--- Makefile (revision 473504) +++ Makefile (working copy) @@ -18,8 +18,6 @@ CONFLICTS= ntp-[0-9].* ntp-devel-* USES= ssl USE_RC_SUBR= openntpd -USERS= _ntp -GROUPS= _ntp GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-cacert=${LOCALBASE}/etc/ssl/cert.pem @@ -38,6 +36,13 @@ post-install: .include +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200075 +CONFIGURE_ARGS+=--with-privsep-user=ntpd +.else +USERS= _ntp +GROUPS= _ntp +.endif + # Requires libtls from LibreSSL .if ${SSL_DEFAULT:Mlibressl*} CPPFLAGS+= -I${OPENSSLINC} --- files/patch-src_ntp.c (nonexistent) +++ files/patch-src_ntp.c (working copy) @@ -0,0 +1,12 @@ +--- src/ntp.c.orig 2018-07-21 20:35:38 UTC ++++ src/ntp.c +@@ -117,7 +117,8 @@ ntp_main(struct ntpd_conf *nconf, struct + if (stat(pw->pw_dir, &stb) == -1) { + fatal("privsep dir %s could not be opened", pw->pw_dir); + } +- if (stb.st_uid != 0 || (stb.st_mode & (S_IWGRP|S_IWOTH)) != 0) { ++ if (stb.st_uid != pw->pw_uid && ++ stb.st_uid != 0 || (stb.st_mode & (S_IWGRP|S_IWOTH)) != 0) { + fatalx("bad privsep dir %s permissions: %o", + pw->pw_dir, stb.st_mode); + }