From: Miroslav Lichvar Date: Tue, 8 Sep 2020 07:45:13 +0000 (+0200) Subject: configure: fix building with -NTP -CMDMON +SCFILTER X-Git-Tag: 4.0-pre4~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff466439fc22d6a47594f5dda33a5bdb726e92b8;p=thirdparty%2Fchrony.git configure: fix building with -NTP -CMDMON +SCFILTER Don't enable privileged operations using the nameserv code unless NTP is enabled. --- diff --git a/configure b/configure index 5c4febff..691d08ee 100755 --- a/configure +++ b/configure @@ -804,10 +804,12 @@ if [ $feat_scfilter = "1" ] && [ $try_seccomp = "1" ] && \ 'seccomp_init(SCMP_ACT_KILL);' then add_def FEAT_SCFILTER - # NAME2IPADDRESS shouldn't be enabled with other operations as the helper - # process works on one request at the time and the async resolver could - # block the main thread - priv_ops="NAME2IPADDRESS RELOADDNS" + if [ $feat_ntp = "1" ]; then + # NAME2IPADDRESS shouldn't be enabled together with a privops operation + # used by the main thread as the helper process works on one request at + # a time and the async resolver would block the main thread + priv_ops="NAME2IPADDRESS RELOADDNS" + fi EXTRA_LIBS="$EXTRA_LIBS -lseccomp" fi diff --git a/stubs.c b/stubs.c index 36f20f79..ae41a839 100644 --- a/stubs.c +++ b/stubs.c @@ -49,7 +49,7 @@ #include "sched.h" #include "util.h" -#ifndef FEAT_ASYNCDNS +#if defined(FEAT_NTP) && !defined(FEAT_ASYNCDNS) /* This is a blocking implementation used when asynchronous resolving is not available */ diff --git a/test/compilation/001-features b/test/compilation/001-features index 7b92ad56..9bd340f8 100755 --- a/test/compilation/001-features +++ b/test/compilation/001-features @@ -17,12 +17,15 @@ for opts in \ "--disable-rtc" \ "--disable-sechash" \ "--disable-cmdmon" \ + "--disable-cmdmon --enable-scfilter" \ "--disable-ntp" \ + "--disable-ntp --enable-scfilter" \ "--disable-nts" \ "--disable-refclock" \ "--disable-timestamping" \ "--disable-timestamping --disable-ntp" \ "--disable-cmdmon --disable-ntp" \ + "--disable-cmdmon --disable-ntp --enable-scfilter" \ "--disable-cmdmon --disable-refclock" \ "--disable-cmdmon --disable-ntp --disable-refclock" do