Index: head/net/ntp/Makefile =================================================================== --- head/net/ntp/Makefile (revision 517693) +++ head/net/ntp/Makefile (revision 517694) @@ -1,93 +1,93 @@ # Created by: andreas # $FreeBSD$ PORTNAME= ntp PORTVERSION= 4.2.8p13 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= net MASTER_SITES= http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ \ http://archive.ntp.org/ntp4/ntp-4.2/ \ ftp://ftp.netlab.is.tsukuba.ac.jp/pub/network/ntp/ntp4/ DISTNAME= ${PORTNAME}-${PORTVERSION:S/P/p/:S/.r/-RC/} MAINTAINER= cy@FreeBSD.org COMMENT= The Network Time Protocol Distribution LIB_DEPENDS= libevent.so:devel/libevent CONFLICTS= ntp-devel-* openntpd-* USES= cpe pathfix shebangfix libedit libtool localbase:ldflags \ pkgconfig USES+= autoreconf # until rlimit_memlock changes accepted upstream GNU_CONFIGURE= yes CONFIGURE_ARGS= --enable-leap-smear --enable-trustedbsd-mac \ --with-locfile=freebsd --with-memlock=-1 TEST_TARGET= check SHEBANG_FILES= scripts/ntptrace/ntptrace.in \ scripts/ntp-wait/ntp-wait.in \ scripts/update-leap/update-leap.in perl_OLD_CMD= @PATH_PERL@ SUB_FILES= pkg-message .include "Makefile.inc" OPTIONS_DEFINE+= DEBUG NLS THREADS OPTIONS_DEFAULT+= THREADS OPTIONS_SUB= yes DEBUG_CONFIGURE_ENABLE= debugging IPV6_CONFIGURE_ENABLE= ipv6 NLS_CONFIGURE_ENABLE= nls NLS_CONFIGURE_OFF= ac_cv_lib_intl_gettext=no NLS_USES= gettext-runtime NTP_SIGND_CONFIGURE_ENABLE= ntp-signd NTPSNMPD_LIB_DEPENDS= libnetsnmp.so:net-mgmt/net-snmp NTPSNMPD_CONFIGURE_OFF= --without-ntpsnmpd PERL_UTILS_USES= perl5 SSL_CONFIGURE_ON= --with-openssl-incdir=${OPENSSLINC} \ --with-openssl-libdir=${OPENSSLLIB} SSL_CONFIGURE_OFF= --without-crypto SSL_USES= ssl DEBUG_CONFIGURE_ON= --enable-debug THREADS_CONFIGURE_ENABLE= thread-support THREADS_CONFIGURE_WITH= threads MD5_LIB_DEPENDS= libmd5.so:www/libwww MD5_IMPLIES= SSL .for D in ${NTP_DRIVERS} ${D}_CONFIGURE_ENABLE= ${D} .endfor .include # XXX Temporary hack. Remember to remove this next commit. post-extract: @${TOUCH} ${WRKSRC}/scripts/build/checkHtmlFileDates @${CHMOD} +x ${WRKSRC}/scripts/build/checkHtmlFileDates post-configure: @${ECHO_CMD} '#define HAVE_CLOSEFROM 1' >> ${WRKSRC}/config.h post-install: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/conf/* ${STAGEDIR}${EXAMPLESDIR} @${MKDIR} ${STAGEDIR}${DOCSDIR} @${FIND} ${WRKSRC}/html -type f | ${XARGS} ${CHMOD} ${SHAREMODE} @cd ${WRKSRC}/html && ${FIND} . -print | \ ${CPIO} -pdu -R ${SHAREOWN}:${SHAREGRP} --quiet ${STAGEDIR}${DOCSDIR} .include Index: head/net/ntp/files/patch-ntpd_ntpd.c =================================================================== --- head/net/ntp/files/patch-ntpd_ntpd.c (revision 517693) +++ head/net/ntp/files/patch-ntpd_ntpd.c (revision 517694) @@ -1,11 +1,48 @@ --- ntpd/ntpd.c.orig 2019-02-20 09:21:44.000000000 -0800 -+++ ntpd/ntpd.c 2019-09-20 12:11:54.469651000 -0700 -@@ -999,7 +999,7 @@ ++++ ntpd/ntpd.c 2019-11-15 08:03:34.800596000 -0800 +@@ -138,6 +138,17 @@ + # include + #endif /* LIBSECCOMP and KERN_SECCOMP */ + ++#ifdef __FreeBSD__ ++#include ++#ifndef PROC_STACKGAP_CTL ++/* ++ * Even if we compile on an older system we can still run on a newer one. ++ */ ++#define PROC_STACKGAP_CTL 17 ++#define PROC_STACKGAP_DISABLE 0x0002 ++#endif ++#endif ++ + #ifdef HAVE_DNSREGISTRATION + # include + DNSServiceRef mdns; +@@ -402,6 +413,18 @@ + char *argv[] + ) + { ++#ifdef __FreeBSD__ ++ { ++ /* ++ * We Must disable ASLR stack gap on FreeBSD to avoid a ++ * segfault. See PR/241421 and PR/241960. ++ */ ++ int aslr_var = PROC_STACKGAP_DISABLE; ++ ++ pid_t my_pid = getpid(); ++ procctl(P_PID, my_pid, PROC_STACKGAP_CTL, &aslr_var); ++ } ++#endif + return ntpdmain(argc, argv); + } + #endif /* !SYS_WINNT */ +@@ -999,7 +1022,7 @@ # if defined(HAVE_MLOCKALL) # ifdef HAVE_SETRLIMIT ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); -# ifdef RLIMIT_MEMLOCK +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 /* * The default RLIMIT_MEMLOCK is very low on Linux systems. * Unless we increase this limit malloc calls are likely to Index: head/net/ntp-devel/Makefile =================================================================== --- head/net/ntp-devel/Makefile (revision 517693) +++ head/net/ntp-devel/Makefile (revision 517694) @@ -1,92 +1,92 @@ # Created by: andreas # $FreeBSD$ PORTNAME= ntp PORTVERSION= 4.3.99 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= net MASTER_SITES= http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-dev/ \ http://archive.ntp.org/ntp4/ntp-dev/ PKGNAMESUFFIX= -devel DISTNAME= ${PORTNAME}-dev-${PORTVERSION:S/P/p/:S/r/-RC/:S/b/-beta/} MAINTAINER= cy@FreeBSD.org COMMENT= The Network Time Protocol Distribution LIB_DEPENDS= libevent.so:devel/libevent CONFLICTS= ntp-[0-9].* openntpd-* USES= cpe pathfix shebangfix libedit libtool localbase:ldflags \ pkgconfig gettext-runtime USES+= autoreconf # until rlimit_memlock changes accepted upstream LIB_DEPENDS+= libdns_sd.so:net/mDNSResponder GNU_CONFIGURE= yes CONFIGURE_ARGS= --enable-leap-smear --enable-trustedbsd-mac \ --with-locfile=freebsd --with-memlock=-1 TEST_TARGET= check SHEBANG_FILES= scripts/ntptrace/ntptrace.in \ scripts/ntp-wait/ntp-wait.in \ scripts/update-leap/update-leap.in perl_OLD_CMD= @PATH_PERL@ SUB_FILES= pkg-message .include "Makefile.inc" OPTIONS_DEFINE+= DEBUG NLS THREADS OPTIONS_DEFAULT+= THREADS OPTIONS_SUB= yes IPV6_CONFIGURE_ENABLE= ipv6 NLS_CONFIGURE_ENABLE= nls NLS_CONFIGURE_OFF= ac_cv_lib_intl_gettext=no NLS_USES= gettext-runtime NTP_SIGND_CONFIGURE_ENABLE= ntp-signd NTPSNMPD_LIB_DEPENDS= libnetsnmp.so:net-mgmt/net-snmp NTPSNMPD_CONFIGURE_OFF= --without-ntpsnmpd PERL_UTILS_USES= perl5 SSL_CONFIGURE_ON= --with-openssl-incdir=${OPENSSLINC} \ --with-openssl-libdir=${OPENSSLLIB} SSL_CONFIGURE_OFF= --without-crypto SSL_USES= ssl SSL_BROKEN_OFF= Includes OpenSSL when deselected DEBUG_CONFIGURE_ON= --enable-debug THREADS_CONFIGURE_ENABLE= thread-support THREADS_CONFIGURE_WITH= threads .for D in ${NTP_DRIVERS} ${D}_CONFIGURE_ENABLE= ${D} .endfor .include # XXX Temporary hack. Remember to remove this next commit. post-extract: @${TOUCH} ${WRKSRC}/scripts/build/checkHtmlFileDates @${CHMOD} +x ${WRKSRC}/scripts/build/checkHtmlFileDates post-configure: @${ECHO_CMD} '#define HAVE_CLOSEFROM 1' >> ${WRKSRC}/config.h post-install: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/conf/* ${STAGEDIR}${EXAMPLESDIR} @${MKDIR} ${STAGEDIR}${DOCSDIR} @${FIND} ${WRKSRC}/html -type f | ${XARGS} ${CHMOD} ${SHAREMODE} @cd ${WRKSRC}/html && ${FIND} . -print | \ ${CPIO} -pdu -R ${SHAREOWN}:${SHAREGRP} --quiet ${STAGEDIR}${DOCSDIR} .include Index: head/net/ntp-devel/files/patch-ntpd_ntpd.c =================================================================== --- head/net/ntp-devel/files/patch-ntpd_ntpd.c (revision 517693) +++ head/net/ntp-devel/files/patch-ntpd_ntpd.c (revision 517694) @@ -1,11 +1,48 @@ --- ntpd/ntpd.c.orig 2019-06-07 01:59:15.000000000 -0700 -+++ ntpd/ntpd.c 2019-09-20 12:13:28.810552000 -0700 -@@ -999,7 +999,7 @@ ++++ ntpd/ntpd.c 2019-11-15 08:06:37.290504000 -0800 +@@ -138,6 +138,17 @@ + # include + #endif /* LIBSECCOMP and KERN_SECCOMP */ + ++#ifdef __FreeBSD__ ++#include ++#ifndef PROC_STACKGAP_CTL ++/* ++ * Even if we compile on an older system we can still run on a newer one. ++ */ ++#define PROC_STACKGAP_CTL 17 ++#define PROC_STACKGAP_DISABLE 0x0002 ++#endif ++#endif ++ + #ifdef HAVE_DNSREGISTRATION + # include + DNSServiceRef mdns; +@@ -402,6 +413,18 @@ + char *argv[] + ) + { ++#ifdef __FreeBSD__ ++ { ++ /* ++ * We Must disable ASLR stack gap on FreeBSD to avoid a ++ * segfault. See PR/241421 and PR/241960. ++ */ ++ int aslr_var = PROC_STACKGAP_DISABLE; ++ ++ pid_t my_pid = getpid(); ++ procctl(P_PID, my_pid, PROC_STACKGAP_CTL, &aslr_var); ++ } ++#endif + return ntpdmain(argc, argv); + } + #endif /* !SYS_WINNT */ +@@ -999,7 +1022,7 @@ # if defined(HAVE_MLOCKALL) # ifdef HAVE_SETRLIMIT ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); -# ifdef RLIMIT_MEMLOCK +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 /* * The default RLIMIT_MEMLOCK is very low on Linux systems. * Unless we increase this limit malloc calls are likely to