From: Jeremy Harris Date: Thu, 25 Jun 2020 09:41:49 +0000 (+0100) Subject: Build: guards on openat() X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/1077d3c3f960c4e5a157c51815b8009f5114ab1a Build: guards on openat() --- 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