+* [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup.
* [Bug 2649] Clean up html/ page installation.
(4.2.7p473) 2014/09/06 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 2649] Clean up html/ page installation.
[AC_DEFINE([LIBSECCOMP], [1],
[Define to any value to include libseccomp sandboxing.])]
)
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <sys/prctl.h>
+ #include <linux/seccomp.h>
+
+ int main(void)
+ {
+ int ret;
+ ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
+ if (ret < 0) {
+ switch (errno) {
+ case ENOSYS:
+ return 1;
+ case EINVAL:
+ return 1;
+ default:
+ return 1;
+ }
+ }
+ ret =
+ prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
+ if (ret < 0) {
+ switch (errno) {
+ case EINVAL:
+ return 1;
+ case EFAULT:
+ return 0;
+ default:
+ return 1;
+ }
+ }
+return 1;
+}
+]
+, AC_DEFINE([KERN_SECCOMP], 1,
+[Define to use libseccomp system call filtering.])
+, []
+)
;;
esac
#endif /* HAVE_PRIV_H */
#endif /* HAVE_DROPROOT */
-#if defined (LIBSECCOMP)
+#if defined (LIBSECCOMP) && (KERN_SECCOMP)
/* # include <sys/types.h> */
# include <sys/resource.h>
# include <seccomp.h>
-#endif /* LIBSECCOMP */
+#endif /* LIBSECCOMP and KERN_SECCOMP */
#ifdef HAVE_DNSREGISTRATION
# include <dns_sd.h>
# endif /* HAVE_DROPROOT */
/* libssecomp sandboxing */
-#if defined (LIBSECCOMP)
+#if defined (LIBSECCOMP) && (KERN_SECCOMP)
scmp_filter_ctx ctx;
if ((ctx = seccomp_init(SCMP_ACT_KILL)) < 0)
else {
msyslog(LOG_DEBUG, "%s: seccomp_load() succeeded", __func__);
}
-#endif /* LIBSECCOMP */
+#endif /* LIBSECCOMP and KERN_SECCOMP */
# ifdef HAVE_IO_COMPLETION_PORT