Fix build for OpenSSL 3.0.0 . Bug 2810
[exim.git] / src / src / acl.c
index be17b5768cf80bdddecbf4e7a0754abe613116bd..c55a42b6f0971f218d9bfa45df8c7971a1d5ea5d 100644 (file)
@@ -3,13 +3,14 @@
 *************************************************/
 
 /* Copyright (c) University of Cambridge 1995 - 2018 */
-/* Copyright (c) The Exim Maintainers 2020 */
+/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Code for handling Access Control Lists (ACLs) */
 
 #include "exim.h"
 
+#ifndef MACRO_PREDEF
 
 /* Default callout timeout */
 
@@ -53,6 +54,8 @@ static int msgcond[] = {
   [ACL_WARN] =         BIT(OK)
   };
 
+#endif
+
 /* ACL condition and modifier codes - keep in step with the table that
 follows.
 down. */
@@ -340,6 +343,24 @@ static condition_def conditions[] = {
 };
 
 
+#ifdef MACRO_PREDEF
+# include "macro_predef.h"
+void
+features_acl(void)
+{
+for (condition_def * c = conditions; c < conditions + nelem(conditions); c++)
+  {
+  uschar buf[64], * p, * s;
+  int n = sprintf(CS buf, "_ACL_%s_", c->is_modifier ? "MOD" : "COND");
+  for (p = buf + n, s = c->name; *s; s++) *p++ = toupper(*s);
+  *p = '\0';
+  builtin_macro_create(buf);
+  }
+}
+#endif
+
+
+#ifndef MACRO_PREDEF
 
 /* Return values from decode_control(); used as index so keep in step
 with the controls_list table that follows! */
@@ -1190,7 +1211,7 @@ int rc;
 
 /* Previous success */
 
-if (sender_host_name != NULL) return OK;
+if (sender_host_name) return OK;
 
 /* Previous failure */
 
@@ -2863,7 +2884,7 @@ acl_seen(const uschar * arg, int where, uschar ** log_msgptr)
 enum { SEEN_DEFAULT, SEEN_READONLY, SEEN_WRITE };
 
 const uschar * list = arg;
-int slash = '/', equal = '=', interval, mode = SEEN_DEFAULT, yield = FAIL;
+int slash = '/', interval, mode = SEEN_DEFAULT, yield = FAIL;
 BOOL before;
 int refresh = 10 * 24 * 60 * 60;       /* 10 days */
 const uschar * ele, * key = sender_host_address;
@@ -4837,6 +4858,7 @@ if (is_tainted(value)) putc('-', f);
 fprintf(f, "-acl%c %s %d\n%s\n", name[0], name+1, Ustrlen(value), value);
 }
 
+#endif /* !MACRO_PREDEF */
 /* vi: aw ai sw=2
 */
 /* End of acl.c */