]> gitweb.michael.orlitzky.com - apply-default-acl.git/commitdiff
configure.ac: add checks for openat() and O_NOFOLLOW.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 26 Feb 2018 19:56:00 +0000 (14:56 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 26 Feb 2018 19:56:00 +0000 (14:56 -0500)
configure.ac

index dd028ff0a34ba6a95c8dcbee4850947eb4859915..130b10c8a0539d1ed2be3c608099b25a60423bfe 100644 (file)
@@ -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 <fcntl.h>]])
 
+LT_INIT
 AC_OUTPUT