Build: guards on openat()
authorJeremy Harris <jgh146exb@wizmail.org>
Thu, 25 Jun 2020 09:41:49 +0000 (10:41 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Thu, 25 Jun 2020 09:41:49 +0000 (10:41 +0100)
src/OS/os.h-Linux
src/src/functions.h
src/src/transports/queuefile.c

index c705e5cd29eaa1f8b1fa1c2f3f56781e4658b9e4..ba5f13450251d89f5afff43ec88a0edf3b0a99d9 100644 (file)
@@ -71,7 +71,7 @@ then change the 0 to 1 in the next block. */
 # define LLONG_MAX LONG_LONG_MAX
 #endif
 
-#if _POSIX_C_SOURCE >= 200809L || _ATFILE_SOUCE
+#if _POSIX_C_SOURCE >= 200809L || _ATFILE_SOURCE
 # define EXIM_HAVE_OPENAT
 #endif
 
index 110d4db1944aa97a6a2a967883bfd99b61b15627..54de974c6074ff73dd6bdd5040464a4458758b45 100644 (file)
@@ -1104,6 +1104,7 @@ log_write(0, LOG_MAIN|LOG_PANIC, "Tainted filename '%s'", pathname);
 errno = EACCES;
 return -1;
 }
+#ifdef EXIM_HAVE_OPENAT
 static inline int
 exim_openat(int dirfd, const char *pathname, int flags)
 {
@@ -1120,6 +1121,7 @@ log_write(0, LOG_MAIN|LOG_PANIC, "Tainted filename '%s'", pathname);
 errno = EACCES;
 return -1;
 }
+#endif
 
 static inline FILE *
 exim_fopen(const char *pathname, const char *mode)
index 21ed3527f3f575fc539da63783e45faf75b3e8f9..259bfd9410be50e004fcc1f396ea351c2e168d56 100644 (file)
 #include "../exim.h"
 #include "queuefile.h"
 
+#ifndef EXIM_HAVE_OPENAT
+# error queuefile transport reqires openat() support
+#endif
+
 /* Options specific to the appendfile transport. They must be in alphabetic
 order (note that "_" comes before the lower case letters). Some of them are
 stored in the publicly visible instance block - these are flagged with the