]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
configure: fix building with -NTP -CMDMON +SCFILTER
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 8 Sep 2020 07:45:13 +0000 (09:45 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Sep 2020 07:36:35 +0000 (09:36 +0200)
Don't enable privileged operations using the nameserv code unless
NTP is enabled.

configure
stubs.c
test/compilation/001-features

index 5c4febffc7dbe289ace59c82692cfac2f63f477f..691d08ee93a77e49a7157a54b213abb7637938c2 100755 (executable)
--- 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 36f20f79dc8532d96b99ea0d9ad1f29c54dde88a..ae41a8390a662788a6d62792006dcff36b30b4b1 100644 (file)
--- 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 */
 
index 7b92ad564e04ab1ccb11fe75a4171b95573b4c33..9bd340f850124cb9d6e67fc398ed9263fa9eb088 100755 (executable)
@@ -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