From d806ef795948c87e614cb2a4cfb80ec96a07d256 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 26 Feb 2018 14:56:00 -0500 Subject: [PATCH] configure.ac: add checks for openat() and O_NOFOLLOW. --- configure.ac | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index dd028ff..130b10c 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,15 @@ AC_TYPE_MODE_T AC_CHECK_HEADERS([ fcntl.h ftw.h getopt.h libgen.h limits.h sys/acl.h ]) AC_CHECK_HEADERS([ sys/libacl.h sys/types.h unistd.h ]) -LT_INIT +# We need openat() with O_NOFOLLOW from POSIX-2008. Without them, we +# can't operate securely; I would rather refuse to be built. +AC_CHECK_FUNC(openat, + [], + AC_MSG_ERROR(missing required openat function)) +AC_CHECK_DECLS([O_NOFOLLOW], + [], + [AC_MSG_ERROR(missing required O_NOFOLLOW flag in fcntl.h)], + [[#include ]]) +LT_INIT AC_OUTPUT -- 2.43.2