summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2020-06-25 10:41:49 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2020-06-25 10:41:49 +0100
commit1077d3c3f960c4e5a157c51815b8009f5114ab1a (patch)
treef75c4dcad89e050957dfb7718abc18fa17073395 /src
parentbec94709e708f087fe7fa456bec95d4e63edc3ed (diff)
Build: guards on openat()
Diffstat (limited to 'src')
-rw-r--r--src/OS/os.h-Linux2
-rw-r--r--src/src/functions.h2
-rw-r--r--src/src/transports/queuefile.c4
3 files changed, 7 insertions, 1 deletions
diff --git a/src/OS/os.h-Linux b/src/OS/os.h-Linux
index c705e5cd2..ba5f13450 100644
--- a/src/OS/os.h-Linux
+++ b/src/OS/os.h-Linux
@@ -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
diff --git a/src/src/functions.h b/src/src/functions.h
index 110d4db19..54de974c6 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -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)
diff --git a/src/src/transports/queuefile.c b/src/src/transports/queuefile.c
index 21ed3527f..259bfd941 100644
--- a/src/src/transports/queuefile.c
+++ b/src/src/transports/queuefile.c
@@ -11,6 +11,10 @@
#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