Authenticator gsasl: client support. Bug 2349
[users/heiko/exim.git] / src / src / drtables.c
index 10b4ae8e0051ad054bfd17a08356f9e2952ff5ad..f2022880b4ab74933fb5d7546af4f7ef4c1f7fc7 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2016 */
+/* Copyright (c) University of Cambridge 1995 - 2018 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -35,6 +35,10 @@ set to NULL for those that are not compiled into the binary. */
 #include "auths/dovecot.h"
 #endif
 
+#ifdef AUTH_EXTERNAL
+#include "auths/external.h"
+#endif
+
 #ifdef AUTH_GSASL
 #include "auths/gsasl_exim.h"
 #endif
@@ -101,6 +105,20 @@ auth_info auths_available[] = {
   },
 #endif
 
+#ifdef AUTH_EXTERNAL
+  {
+  .driver_name =       US"external",
+  .options =           auth_external_options,
+  .options_count =     &auth_external_options_count,
+  .options_block =     &auth_external_option_defaults,
+  .options_len =       sizeof(auth_external_options_block),
+  .init =              auth_external_init,
+  .servercode =                auth_external_server,
+  .clientcode =                auth_external_client,
+  .version_report =    NULL
+  },
+#endif
+
 #ifdef AUTH_GSASL
   {
   .driver_name =       US"gsasl",
@@ -110,7 +128,7 @@ auth_info auths_available[] = {
   .options_len =       sizeof(auth_gsasl_options_block),
   .init =              auth_gsasl_init,
   .servercode =                auth_gsasl_server,
-  .clientcode =                NULL,
+  .clientcode =                auth_gsasl_client,
   .version_report =    auth_gsasl_version_report
   },
 #endif
@@ -119,7 +137,7 @@ auth_info auths_available[] = {
   {
   .driver_name =       US"heimdal_gssapi",
   .options =           auth_heimdal_gssapi_options,
-  .options_count        &auth_heimdal_gssapi_options_count,
+  .options_count =     &auth_heimdal_gssapi_options_count,
   .options_block =     &auth_heimdal_gssapi_option_defaults,
   .options_len =       sizeof(auth_heimdal_gssapi_options_block),
   .init =              auth_heimdal_gssapi_init,
@@ -171,9 +189,18 @@ auth_info auths_available[] = {
   },
 #endif
 
-{ .driver_name = US"" }                /* end marker */
+  { .driver_name = US"" }              /* end marker */
 };
 
+void
+auth_show_supported(FILE * f)
+{
+fprintf(f, "Authenticators:");
+for (auth_info * ai = auths_available; ai->driver_name[0]; ai++)
+               fprintf(f, " %s", ai->driver_name);
+fprintf(f, "\n");
+}
+
 
 /* Tables of information about which routers and transports are included in the
 exim binary. */
@@ -329,10 +356,21 @@ router_info routers_available[] = {
   .ri_flags =          ri_notransport
   },
 #endif
-{ US"" }
+  { US"" }
 };
 
 
+void
+route_show_supported(FILE * f)
+{
+fprintf(f, "Routers:");
+for (router_info * rr = routers_available; rr->driver_name[0]; rr++)
+               fprintf(f, " %s", rr->driver_name);
+fprintf(f, "\n");
+}
+
+
+
 
 transport_info transports_available[] = {
 #ifdef TRANSPORT_APPENDFILE
@@ -419,9 +457,43 @@ transport_info transports_available[] = {
   .local =             FALSE
   },
 #endif
-{ US"" }
+  { US"" }
 };
 
+void
+transport_show_supported(FILE * f)
+{
+fprintf(f, "Transports:");
+#ifdef TRANSPORT_APPENDFILE
+  fprintf(f, " appendfile");
+  #ifdef SUPPORT_MAILDIR
+    fprintf(f, "/maildir");    /* damn these subclasses */
+  #endif
+  #ifdef SUPPORT_MAILSTORE
+    fprintf(f, "/mailstore");
+  #endif
+  #ifdef SUPPORT_MBX
+    fprintf(f, "/mbx");
+  #endif
+#endif
+#ifdef TRANSPORT_AUTOREPLY
+  fprintf(f, " autoreply");
+#endif
+#ifdef TRANSPORT_LMTP
+  fprintf(f, " lmtp");
+#endif
+#ifdef TRANSPORT_PIPE
+  fprintf(f, " pipe");
+#endif
+#ifdef EXPERIMENTAL_QUEUEFILE
+  fprintf(f, " queuefile");
+#endif
+#ifdef TRANSPORT_SMTP
+  fprintf(f, " smtp");
+#endif
+fprintf(f, "\n");
+}
+
 
 #ifndef MACRO_PREDEF
 
@@ -437,7 +509,7 @@ static struct lookupmodulestr *lookupmodules = NULL;
 static void
 addlookupmodule(void *dl, struct lookup_module_info *info)
 {
-struct lookupmodulestr *p = store_malloc(sizeof(struct lookupmodulestr));
+struct lookupmodulestr *p = store_get(sizeof(struct lookupmodulestr), FALSE);
 
 p->dl = dl;
 p->info = info;
@@ -492,6 +564,9 @@ extern lookup_module_info dsearch_lookup_module_info;
 #if defined(LOOKUP_IBASE) && LOOKUP_IBASE!=2
 extern lookup_module_info ibase_lookup_module_info;
 #endif
+#if defined(LOOKUP_JSON)
+extern lookup_module_info json_lookup_module_info;
+#endif
 #if defined(LOOKUP_LDAP)
 extern lookup_module_info ldap_lookup_module_info;
 #endif
@@ -522,7 +597,7 @@ extern lookup_module_info redis_lookup_module_info;
 #if defined(EXPERIMENTAL_LMDB)
 extern lookup_module_info lmdb_lookup_module_info;
 #endif
-#if defined(EXPERIMENTAL_SPF)
+#if defined(SUPPORT_SPF)
 extern lookup_module_info spf_lookup_module_info;
 #endif
 #if defined(LOOKUP_SQLITE) && LOOKUP_SQLITE!=2
@@ -545,12 +620,12 @@ init_lookup_list(void)
   int countmodules = 0;
   int moduleerrors = 0;
 #endif
-  struct lookupmodulestr *p;
   static BOOL lookup_list_init_done = FALSE;
-
+  rmark reset_point;
 
   if (lookup_list_init_done)
     return;
+  reset_point = store_mark();
   lookup_list_init_done = TRUE;
 
 #if defined(LOOKUP_CDB) && LOOKUP_CDB!=2
@@ -577,6 +652,10 @@ init_lookup_list(void)
   addlookupmodule(NULL, &ldap_lookup_module_info);
 #endif
 
+#ifdef LOOKUP_JSON
+  addlookupmodule(NULL, &json_lookup_module_info);
+#endif
+
 #if defined(LOOKUP_LSEARCH) && LOOKUP_LSEARCH!=2
   addlookupmodule(NULL, &lsearch_lookup_module_info);
 #endif
@@ -613,7 +692,7 @@ init_lookup_list(void)
   addlookupmodule(NULL, &lmdb_lookup_module_info);
 #endif
 
-#ifdef EXPERIMENTAL_SPF
+#ifdef SUPPORT_SPF
   addlookupmodule(NULL, &spf_lookup_module_info);
 #endif
 
@@ -708,18 +787,10 @@ init_lookup_list(void)
   memset(lookup_list, 0, sizeof(lookup_info *) * lookup_list_count);
 
   /* now add all lookups to the real list */
-  p = lookupmodules;
-  while (p) {
-    int j;
-    struct lookupmodulestr *pnext;
-
-    for (j = 0; j < p->info->lookupcount; j++)
+  for (struct lookupmodulestr * p = lookupmodules; p; p = p->next)
+    for (int j = 0; j < p->info->lookupcount; j++)
       add_lookup_to_list(p->info->lookups[j]);
-
-    pnext = p->next;
-    store_free(p);
-    p = pnext;
-  }
+  store_reset(reset_point);
   /* just to be sure */
   lookupmodules = NULL;
 }