Debug: feed startup "whats supported" info through normal debug channel
authorJeremy Harris <jgh146exb@wizmail.org>
Fri, 4 Feb 2022 00:37:51 +0000 (00:37 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Fri, 4 Feb 2022 19:28:31 +0000 (19:28 +0000)
39 files changed:
src/src/auths/cyrus_sasl.c
src/src/auths/cyrus_sasl.h
src/src/auths/gsasl_exim.c
src/src/auths/gsasl_exim.h
src/src/auths/heimdal_gssapi.c
src/src/auths/heimdal_gssapi.h
src/src/dmarc.c
src/src/dmarc.h
src/src/exim.c
src/src/functions.h
src/src/lookupapi.h
src/src/lookups/cdb.c
src/src/lookups/dbmdb.c
src/src/lookups/dnsdb.c
src/src/lookups/dsearch.c
src/src/lookups/ibase.c
src/src/lookups/json.c
src/src/lookups/ldap.c
src/src/lookups/lmdb.c
src/src/lookups/lsearch.c
src/src/lookups/mysql.c
src/src/lookups/nis.c
src/src/lookups/nisplus.c
src/src/lookups/oracle.c
src/src/lookups/passwd.c
src/src/lookups/pgsql.c
src/src/lookups/redis.c
src/src/lookups/spf.c
src/src/lookups/sqlite.c
src/src/lookups/testdb.c
src/src/lookups/whoson.c
src/src/spf.c
src/src/spf.h
src/src/structs.h
src/src/tls-gnu.c
src/src/tls-openssl.c
src/src/utf8.c
test/runtest
test/stderr/0574

index ecaf23bc2d9305d05680a0acd393c964af83585f..2aa95dfbb33263642990fdef41f233f7b2670f9d 100644 (file)
@@ -71,7 +71,7 @@ void auth_cyrus_sasl_init(auth_instance *ablock) {}
 int auth_cyrus_sasl_server(auth_instance *ablock, uschar *data) {return 0;}
 int auth_cyrus_sasl_client(auth_instance *ablock, void * sx,
   int timeout, uschar *buffer, int buffsize) {return 0;}
 int auth_cyrus_sasl_server(auth_instance *ablock, uschar *data) {return 0;}
 int auth_cyrus_sasl_client(auth_instance *ablock, void * sx,
   int timeout, uschar *buffer, int buffsize) {return 0;}
-void auth_cyrus_sasl_version_report(FILE *f) {}
+gstring * auth_cyrus_sasl_version_report(gstring * g) {return NULL;}
 
 #else   /*!MACRO_PREDEF*/
 
 
 #else   /*!MACRO_PREDEF*/
 
@@ -476,15 +476,17 @@ return 0;  /* Stop compiler complaints */
 *                Diagnostic API                  *
 *************************************************/
 
 *                Diagnostic API                  *
 *************************************************/
 
-void
-auth_cyrus_sasl_version_report(FILE *f)
+gstring *
+auth_cyrus_sasl_version_report(gstring * g)
 {
 {
-const char *implementation, *version;
+const char * implementation, * version;
 sasl_version_info(&implementation, &version, NULL, NULL, NULL, NULL);
 sasl_version_info(&implementation, &version, NULL, NULL, NULL, NULL);
-fprintf(f, "Library version: Cyrus SASL: Compile: %d.%d.%d\n"
-          "                             Runtime: %s [%s]\n",
+g = string_fmt_append(g,
+       "Library version: Cyrus SASL: Compile: %d.%d.%d\n"
+       "                             Runtime: %s [%s]\n",
        SASL_VERSION_MAJOR, SASL_VERSION_MINOR, SASL_VERSION_STEP,
        version, implementation);
        SASL_VERSION_MAJOR, SASL_VERSION_MINOR, SASL_VERSION_STEP,
        version, implementation);
+return g;
 }
 
 /*************************************************
 }
 
 /*************************************************
index da6f3cd1b05a069f1a4042d39a6e4e9b177c6b1b..0877a79efb17a31bfc5268c23f12742f3afbc9ff 100644 (file)
@@ -30,6 +30,6 @@ extern auth_cyrus_sasl_options_block auth_cyrus_sasl_option_defaults;
 extern void auth_cyrus_sasl_init(auth_instance *);
 extern int auth_cyrus_sasl_server(auth_instance *, uschar *);
 extern int auth_cyrus_sasl_client(auth_instance *, void *, int, uschar *, int);
 extern void auth_cyrus_sasl_init(auth_instance *);
 extern int auth_cyrus_sasl_server(auth_instance *, uschar *);
 extern int auth_cyrus_sasl_client(auth_instance *, void *, int, uschar *, int);
-extern void auth_cyrus_sasl_version_report(FILE *f);
+extern gstring * auth_cyrus_sasl_version_report(gstring *);
 
 /* End of cyrus_sasl.h */
 
 /* End of cyrus_sasl.h */
index 26505446a06c6a8c3d0250798246b2970c8556ed..495ad118916f60c7917990deda756020786b5a97 100644 (file)
@@ -112,7 +112,7 @@ void auth_gsasl_init(auth_instance *ablock) {}
 int auth_gsasl_server(auth_instance *ablock, uschar *data) {return 0;}
 int auth_gsasl_client(auth_instance *ablock, void * sx,
   int timeout, uschar *buffer, int buffsize) {return 0;}
 int auth_gsasl_server(auth_instance *ablock, uschar *data) {return 0;}
 int auth_gsasl_client(auth_instance *ablock, void * sx,
   int timeout, uschar *buffer, int buffsize) {return 0;}
-void auth_gsasl_version_report(FILE *f) {}
+gstring * auth_gsasl_version_report(gstring * g) {return NULL;}
 
 void
 auth_gsasl_macros(void)
 
 void
 auth_gsasl_macros(void)
@@ -1002,14 +1002,12 @@ return GSASL_NO_CALLBACK;
 *                Diagnostic API                  *
 *************************************************/
 
 *                Diagnostic API                  *
 *************************************************/
 
-void
-auth_gsasl_version_report(FILE *f)
+gstring *
+auth_gsasl_version_report(gstring * g)
 {
 {
-const char *runtime;
-runtime = gsasl_check_version(NULL);
-fprintf(f, "Library version: GNU SASL: Compile: %s\n"
-          "                           Runtime: %s\n",
-       GSASL_VERSION, runtime);
+return string_fmt_append(g, "Library version: GNU SASL: Compile: %s\n"
+                           "                           Runtime: %s\n",
+       GSASL_VERSION, gsasl_check_version(NULL));
 }
 
 
 }
 
 
index 028259a8f9fccd5ae6f0911080b5bda4dd9931f4..93e62436259b727abf5cab61e36f4e56dfce5e88 100644 (file)
@@ -47,7 +47,7 @@ extern void auth_gsasl_init(auth_instance *);
 extern int auth_gsasl_server(auth_instance *, uschar *);
 extern int auth_gsasl_client(auth_instance *, void *,
                                int, uschar *, int);
 extern int auth_gsasl_server(auth_instance *, uschar *);
 extern int auth_gsasl_client(auth_instance *, void *,
                                int, uschar *, int);
-extern void auth_gsasl_version_report(FILE *f);
+extern gstring * auth_gsasl_version_report(gstring *);
 extern void auth_gsasl_macros(void);
 
 /* End of gsasl_exim.h */
 extern void auth_gsasl_macros(void);
 
 /* End of gsasl_exim.h */
index a09d454131d9c66dc2bec1e928b772a5d6ae7a86..3ba24b4ed6a095b59ef28451f354ba0ea40b9203 100644 (file)
@@ -85,7 +85,7 @@ void auth_heimdal_gssapi_init(auth_instance *ablock) {}
 int auth_heimdal_gssapi_server(auth_instance *ablock, uschar *data) {return 0;}
 int auth_heimdal_gssapi_client(auth_instance *ablock, void * sx,
   int timeout, uschar *buffer, int buffsize) {return 0;}
 int auth_heimdal_gssapi_server(auth_instance *ablock, uschar *data) {return 0;}
 int auth_heimdal_gssapi_client(auth_instance *ablock, void * sx,
   int timeout, uschar *buffer, int buffsize) {return 0;}
-void auth_heimdal_gssapi_version_report(FILE *f) {}
+gstring * auth_heimdal_gssapi_version_report(gstring * g) {}
 
 #else   /*!MACRO_PREDEF*/
 
 
 #else   /*!MACRO_PREDEF*/
 
@@ -601,14 +601,15 @@ return FAIL;
 *                Diagnostic API                  *
 *************************************************/
 
 *                Diagnostic API                  *
 *************************************************/
 
-void
-auth_heimdal_gssapi_version_report(FILE *f)
+gstring *
+auth_heimdal_gssapi_version_report(gstring * g)
 {
 /* No build-time constants available unless we link against libraries at
 build-time and export the result as a string into a header ourselves. */
 {
 /* No build-time constants available unless we link against libraries at
 build-time and export the result as a string into a header ourselves. */
-fprintf(f, "Library version: Heimdal: Runtime: %s\n"
-          " Build Info: %s\n",
-       heimdal_version, heimdal_long_version);
+
+return string_fmt_append(g, "Library version: Heimdal: Runtime: %s\n"
+                           " Build Info: %s\n",
+       heimdal_version, heimdal_long_version));
 }
 
 #endif   /*!MACRO_PREDEF*/
 }
 
 #endif   /*!MACRO_PREDEF*/
index b682b5ff68773d4430142b6bafae96a81d84cad6..2e5921911bfe8fb8a06a822eb9907757ff41f7f2 100644 (file)
@@ -33,6 +33,6 @@ extern auth_heimdal_gssapi_options_block auth_heimdal_gssapi_option_defaults;
 extern void auth_heimdal_gssapi_init(auth_instance *);
 extern int auth_heimdal_gssapi_server(auth_instance *, uschar *);
 extern int auth_heimdal_gssapi_client(auth_instance *, void *, int, uschar *, int);
 extern void auth_heimdal_gssapi_init(auth_instance *);
 extern int auth_heimdal_gssapi_server(auth_instance *, uschar *);
 extern int auth_heimdal_gssapi_client(auth_instance *, void *, int, uschar *, int);
-extern void auth_heimdal_gssapi_version_report(FILE *f);
+extern void auth_heimdal_gssapi_version_report(BOOL);
 
 /* End of heimdal_gssapi.h */
 
 /* End of heimdal_gssapi.h */
index 060d3ef510395e1338bb61071e30ab0b21a0a4ca..996ca2f4fd9eeefbad586220dfda0924c3e4c6a0 100644 (file)
@@ -53,14 +53,12 @@ static dmarc_exim_p dmarc_policy_description[] = {
 };
 
 
 };
 
 
-void
-dmarc_version_report(FILE *f)
+gstring * g
+dmarc_version_report(gstring * g)
 {
 {
-const char *implementation, *version;
-
-fprintf(f, "Library version: dmarc: Compile: %d.%d.%d.%d\n",
-  (OPENDMARC_LIB_VERSION & 0xff000000) >> 24, (OPENDMARC_LIB_VERSION & 0x00ff0000) >> 16,
-  (OPENDMARC_LIB_VERSION & 0x0000ff00) >> 8, OPENDMARC_LIB_VERSION & 0x000000ff);
+return string_fmt_append(g, "Library version: dmarc: Compile: %d.%d.%d.%d\n",
+    (OPENDMARC_LIB_VERSION & 0xff000000) >> 24, (OPENDMARC_LIB_VERSION & 0x00ff0000) >> 16,
+    (OPENDMARC_LIB_VERSION & 0x0000ff00) >> 8, OPENDMARC_LIB_VERSION & 0x000000ff));
 }
 
 
 }
 
 
index 0b5307abba48833fb648011d24c9d915e7811c1b..de68372ee74f54a7b5e16e28d87f1ac256b8377c 100644 (file)
@@ -18,7 +18,7 @@
 # endif /* SUPPORT_SPF */
 
 /* prototypes */
 # endif /* SUPPORT_SPF */
 
 /* prototypes */
-void dmarc_version_report(FILE *);
+gstring * dmarc_version_report(gstring *)
 int dmarc_init();
 int dmarc_store_data(header_line *);
 int dmarc_process();
 int dmarc_init();
 int dmarc_store_data(header_line *);
 int dmarc_process();
index c35049763050795b3767c131a9ddfcdf97810380..9da921a5c13c833970a0685a94c58e4a004eec5f 100644 (file)
@@ -954,55 +954,66 @@ else
 *          Show supported features               *
 *************************************************/
 
 *          Show supported features               *
 *************************************************/
 
-static void
-show_db_version(FILE * f)
+void
+show_string(BOOL is_stdout, gstring * g)
+{
+const uschar * s = string_from_gstring(g);
+if (is_stdout) fputs(CCS s, stdout);
+else debug_printf("%s", s);
+}
+
+
+static gstring *
+show_db_version(gstring * g)
 {
 #ifdef DB_VERSION_STRING
 DEBUG(D_any)
   {
 {
 #ifdef DB_VERSION_STRING
 DEBUG(D_any)
   {
-  fprintf(f, "Library version: BDB: Compile: %s\n", DB_VERSION_STRING);
-  fprintf(f, "                      Runtime: %s\n",
+  g = string_fmt_append(g, "Library version: BDB: Compile: %s\n", DB_VERSION_STRING);
+  g = string_fmt_append(g, "                      Runtime: %s\n",
     db_version(NULL, NULL, NULL));
   }
 else
     db_version(NULL, NULL, NULL));
   }
 else
-  fprintf(f, "Berkeley DB: %s\n", DB_VERSION_STRING);
+  g = string_fmt_append(g, "Berkeley DB: %s\n", DB_VERSION_STRING);
 
 #elif defined(BTREEVERSION) && defined(HASHVERSION)
 
 #elif defined(BTREEVERSION) && defined(HASHVERSION)
-  #ifdef USE_DB
-  fprintf(f, "Probably Berkeley DB version 1.8x (native mode)\n");
-  #else
-  fprintf(f, "Probably Berkeley DB version 1.8x (compatibility mode)\n");
-  #endif
+ifdef USE_DB
+  g = string_cat(g, US"Probably Berkeley DB version 1.8x (native mode)\n");
+else
+  g = string_cat(g, US"Probably Berkeley DB version 1.8x (compatibility mode)\n");
+endif
 
 #elif defined(_DBM_RDONLY) || defined(dbm_dirfno)
 
 #elif defined(_DBM_RDONLY) || defined(dbm_dirfno)
-fprintf(f, "Probably ndbm\n");
+g = string_cat(g, US"Probably ndbm\n");
 #elif defined(USE_TDB)
 #elif defined(USE_TDB)
-fprintf(f, "Using tdb\n");
+g = string_cat(g, US"Using tdb\n");
 #else
 #else
-  #ifdef USE_GDBM
-  fprintf(f, "Probably GDBM (native mode)\n");
-  #else
-  fprintf(f, "Probably GDBM (compatibility mode)\n");
-  #endif
+ifdef USE_GDBM
+  g = string_cat(g, US"Probably GDBM (native mode)\n");
+else
+  g = string_cat(g, US"Probably GDBM (compatibility mode)\n");
+endif
 #endif
 #endif
+return g;
 }
 
 
 /* This function is called for -bV/--version and for -d to output the optional
 features of the current Exim binary.
 
 }
 
 
 /* This function is called for -bV/--version and for -d to output the optional
 features of the current Exim binary.
 
-Arguments:  a FILE for printing
+Arguments:  BOOL, true for stdout else debug channel
 Returns:    nothing
 */
 
 static void
 Returns:    nothing
 */
 
 static void
-show_whats_supported(FILE * fp)
+show_whats_supported(BOOL is_stdout)
 {
 rmark reset_point = store_mark();
 {
 rmark reset_point = store_mark();
-gstring * g;
-DEBUG(D_any) {} else show_db_version(fp);
+gstring * g = NULL;
+
+DEBUG(D_any) {} else g = show_db_version(g);
 
 
-g = string_cat(NULL, US"Support for:");
+g = string_cat(g, US"Support for:");
 #ifdef SUPPORT_CRYPTEQ
   g = string_cat(g, US" crypteq");
 #endif
 #ifdef SUPPORT_CRYPTEQ
   g = string_cat(g, US" crypteq");
 #endif
@@ -1181,6 +1192,7 @@ g = transport_show_supported(g);
 #ifdef WITH_CONTENT_SCAN
 g = malware_show_supported(g);
 #endif
 #ifdef WITH_CONTENT_SCAN
 g = malware_show_supported(g);
 #endif
+show_string(is_stdout, g); g = NULL;
 
 if (fixed_never_users[0] > 0)
   {
 
 if (fixed_never_users[0] > 0)
   {
@@ -1192,19 +1204,19 @@ if (fixed_never_users[0] > 0)
   }
 
 g = string_fmt_append(g, "Configure owner: %d:%d\n", config_uid, config_gid);
   }
 
 g = string_fmt_append(g, "Configure owner: %d:%d\n", config_uid, config_gid);
-fputs(CS string_from_gstring(g), fp);
 
 
-fprintf(fp, "Size of off_t: " SIZE_T_FMT "\n", sizeof(off_t));
+g = string_fmt_append(g, "Size of off_t: " SIZE_T_FMT "\n", sizeof(off_t));
 
 /* Everything else is details which are only worth reporting when debugging.
 Perhaps the tls_version_report should move into this too. */
 
 /* Everything else is details which are only worth reporting when debugging.
 Perhaps the tls_version_report should move into this too. */
-DEBUG(D_any) do {
+DEBUG(D_any)
+  {
 
 /* clang defines __GNUC__ (at least, for me) so test for it first */
 #if defined(__clang__)
 
 /* clang defines __GNUC__ (at least, for me) so test for it first */
 #if defined(__clang__)
-  fprintf(fp, "Compiler: CLang [%s]\n", __clang_version__);
+  g = string_fmt_append(g, "Compiler: CLang [%s]\n", __clang_version__);
 #elif defined(__GNUC__)
 #elif defined(__GNUC__)
-  fprintf(fp, "Compiler: GCC [%s]\n",
+  g = string_fmt_append(g, "Compiler: GCC [%s]\n",
 # ifdef __VERSION__
       __VERSION__
 # else
 # ifdef __VERSION__
       __VERSION__
 # else
@@ -1212,35 +1224,38 @@ DEBUG(D_any) do {
 # endif
       );
 #else
 # endif
       );
 #else
-  fprintf(fp, "Compiler: <unknown>\n");
+  g = string_cat(g, US"Compiler: <unknown>\n");
 #endif
 
 #if defined(__GLIBC__) && !defined(__UCLIBC__)
 #endif
 
 #if defined(__GLIBC__) && !defined(__UCLIBC__)
-  fprintf(fp, "Library version: Glibc: Compile: %d.%d\n",
+  g = string_fmt_append(g, "Library version: Glibc: Compile: %d.%d\n",
                __GLIBC__, __GLIBC_MINOR__);
   if (__GLIBC_PREREQ(2, 1))
                __GLIBC__, __GLIBC_MINOR__);
   if (__GLIBC_PREREQ(2, 1))
-    fprintf(fp, "                        Runtime: %s\n",
+    g = string_fmt_append(g, "                        Runtime: %s\n",
                gnu_get_libc_version());
 #endif
 
                gnu_get_libc_version());
 #endif
 
-show_db_version(fp);
+g = show_db_version(g);
 
 #ifndef DISABLE_TLS
 
 #ifndef DISABLE_TLS
-  tls_version_report(fp);
+  g = tls_version_report(g);
 #endif
 #ifdef SUPPORT_I18N
 #endif
 #ifdef SUPPORT_I18N
-  utf8_version_report(fp);
+  g = utf8_version_report(g);
 #endif
 #ifdef SUPPORT_DMARC
 #endif
 #ifdef SUPPORT_DMARC
-  dmarc_version_report(fp);
+  g = dmarc_version_report(g);
 #endif
 #ifdef SUPPORT_SPF
 #endif
 #ifdef SUPPORT_SPF
-  spf_lib_version_report(fp);
+  g = spf_lib_version_report(g);
 #endif
 
 #endif
 
-  for (auth_info * authi = auths_available; *authi->driver_name != '\0'; ++authi)
-    if (authi->version_report)
-      (*authi->version_report)(fp);
+show_string(is_stdout, g);
+g = NULL;
+
+for (auth_info * authi = auths_available; *authi->driver_name != '\0'; ++authi)
+  if (authi->version_report)
+    g = (*authi->version_report)(g);
 
   /* PCRE_PRERELEASE is either defined and empty or a bare sequence of
   characters; unless it's an ancient version of PCRE in which case it
 
   /* PCRE_PRERELEASE is either defined and empty or a bare sequence of
   characters; unless it's an ancient version of PCRE in which case it
@@ -1253,7 +1268,7 @@ show_db_version(fp);
   {
   uschar buf[24];
   pcre2_config(PCRE2_CONFIG_VERSION, buf);
   {
   uschar buf[24];
   pcre2_config(PCRE2_CONFIG_VERSION, buf);
-  fprintf(fp, "Library version: PCRE2: Compile: %d.%d%s\n"
+  g = string_fmt_append(g, "Library version: PCRE2: Compile: %d.%d%s\n"
               "                        Runtime: %s\n",
           PCRE2_MAJOR, PCRE2_MINOR,
           EXPAND_AND_QUOTE(PCRE2_PRERELEASE) "",
               "                        Runtime: %s\n",
           PCRE2_MAJOR, PCRE2_MINOR,
           EXPAND_AND_QUOTE(PCRE2_PRERELEASE) "",
@@ -1262,23 +1277,29 @@ show_db_version(fp);
 #undef QUOTE
 #undef EXPAND_AND_QUOTE
 
 #undef QUOTE
 #undef EXPAND_AND_QUOTE
 
-  init_lookup_list();
-  for (int i = 0; i < lookup_list_count; i++)
-    if (lookup_list[i]->version_report)
-      lookup_list[i]->version_report(fp);
+show_string(is_stdout, g);
+g = NULL;
+
+init_lookup_list();
+for (int i = 0; i < lookup_list_count; i++)
+  if (lookup_list[i]->version_report)
+    g = lookup_list[i]->version_report(g);
+show_string(is_stdout, g);
+g = NULL;
 
 #ifdef WHITELIST_D_MACROS
 
 #ifdef WHITELIST_D_MACROS
-  fprintf(fp, "WHITELIST_D_MACROS: \"%s\"\n", WHITELIST_D_MACROS);
+  g = string_fmt_append(g, "WHITELIST_D_MACROS: \"%s\"\n", WHITELIST_D_MACROS);
 #else
 #else
-  fprintf(fp, "WHITELIST_D_MACROS unset\n");
+  g = string_cat(g, US"WHITELIST_D_MACROS unset\n");
 #endif
 #ifdef TRUSTED_CONFIG_LIST
 #endif
 #ifdef TRUSTED_CONFIG_LIST
-  fprintf(fp, "TRUSTED_CONFIG_LIST: \"%s\"\n", TRUSTED_CONFIG_LIST);
+  g = string_fmt_append(g, "TRUSTED_CONFIG_LIST: \"%s\"\n", TRUSTED_CONFIG_LIST);
 #else
 #else
-  fprintf(fp, "TRUSTED_CONFIG_LIST unset\n");
+  g = string_cat(g, US"TRUSTED_CONFIG_LIST unset\n");
 #endif
 #endif
+  }
 
 
-} while (0);
+show_string(is_stdout, g);
 store_reset(reset_point);
 }
 
 store_reset(reset_point);
 }
 
@@ -2441,7 +2462,7 @@ on the second character (the one after '-'), to save some effort. */
              version_cnumber, version_date);
            printf("%s\n", CS version_copyright);
            version_printed = TRUE;
              version_cnumber, version_date);
            printf("%s\n", CS version_copyright);
            version_printed = TRUE;
-           show_whats_supported(stdout);
+           show_whats_supported(TRUE);
            f.log_testing_mode = TRUE;
            }
          else badarg = TRUE;
            f.log_testing_mode = TRUE;
            }
          else badarg = TRUE;
@@ -3754,7 +3775,7 @@ if (debug_selector != 0)
       version_string, (long int)real_uid, (long int)real_gid, (int)getpid(),
       debug_selector);
     if (!version_printed)
       version_string, (long int)real_uid, (long int)real_gid, (int)getpid(),
       debug_selector);
     if (!version_printed)
-      show_whats_supported(stderr);
+      show_whats_supported(FALSE);
     }
   }
 
     }
   }
 
index 2a1142b358f3ef19b613765321fda0dee12495b0..d27c23baa1ac31fd715d6c142d6d6ac2f395ec6b 100644 (file)
@@ -85,7 +85,7 @@ extern void    tls_watch_invalidate(void);
 #endif
 extern int     tls_write(void *, const uschar *, size_t, BOOL);
 extern uschar *tls_validate_require_cipher(void);
 #endif
 extern int     tls_write(void *, const uschar *, size_t, BOOL);
 extern uschar *tls_validate_require_cipher(void);
-extern void    tls_version_report(FILE *);
+extern gstring *tls_version_report(gstring *);
 
 # ifdef SUPPORT_DANE
 extern int     tlsa_lookup(const host_item *, dns_answer *, BOOL);
 
 # ifdef SUPPORT_DANE
 extern int     tlsa_lookup(const host_item *, dns_answer *, BOOL);
@@ -475,6 +475,7 @@ extern void    set_process_info(const char *, ...) PRINTF_FUNCTION(1,2);
 extern void    sha1_end(hctx *, const uschar *, int, uschar *);
 extern void    sha1_mid(hctx *, const uschar *);
 extern void    sha1_start(hctx *);
 extern void    sha1_end(hctx *, const uschar *, int, uschar *);
 extern void    sha1_mid(hctx *, const uschar *);
 extern void    sha1_start(hctx *);
+extern void    show_string(BOOL, gstring *);
 extern int     sieve_interpret(uschar *, int, uschar *, uschar *, uschar *,
                  uschar *, address_item **, uschar **);
 extern void    sigalrm_handler(int);
 extern int     sieve_interpret(uschar *, int, uschar *, uschar *, uschar *,
                  uschar *, address_item **, uschar **);
 extern void    sigalrm_handler(int);
@@ -629,7 +630,7 @@ extern void    tree_walk(tree_node *, void (*)(uschar*, uschar*, void*), void *)
 extern void    unspool_mbox(void);
 #endif
 #ifdef SUPPORT_I18N
 extern void    unspool_mbox(void);
 #endif
 #ifdef SUPPORT_I18N
-extern void    utf8_version_report(FILE *);
+extern gstring *utf8_version_report(gstring *);
 #endif
 
 extern int     verify_address(address_item *, FILE *, int, int, int, int,
 #endif
 
 extern int     verify_address(address_item *, FILE *, int, int, int, int,
index adaed8253cd5f1eacca9327856d79e4fc1a5f171..d8364dbb9970c278db9e8b1559491ed1985b1b44 100644 (file)
@@ -43,8 +43,8 @@ typedef struct lookup_info {
   uschar *(*quote)(               /* quoting function */
     uschar *,                     /* string to quote */
     uschar *);                    /* additional data from quote name */
   uschar *(*quote)(               /* quoting function */
     uschar *,                     /* string to quote */
     uschar *);                    /* additional data from quote name */
-  void (*version_report)(         /* diagnostic function */
-    FILE *);                      /* fh to write to */
+  gstring * (*version_report)(    /* diagnostic function */
+    gstring *);                   /* true: stdout.  false: debug */
 } lookup_info;
 
 /* This magic number is used by the following lookup_module_info structure
 } lookup_info;
 
 /* This magic number is used by the following lookup_module_info structure
index b11f5f7d573119025f4e35b6704e0b9629853ccd..7b9c2cdfd2107b211405a42885d702c580191818 100644 (file)
@@ -458,12 +458,13 @@ if (cdbp->cdb_map)
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-cdb_version_report(FILE *f)
+gstring *
+cdb_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: CDB: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: CDB: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index 508083361151652cc922005d60880ecb7ef66566..c53e5555446ae342867a911751ec9f64bd45caf4 100644 (file)
@@ -227,12 +227,13 @@ EXIM_DBCLOSE((EXIM_DB *)handle);
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-dbm_version_report(FILE *f)
+gstring *
+dbm_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: DBM: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: DBM: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index 781a2aea5da2b06ffc3777e21b54d3ee02490d7f..b1bd48bfc179a4a12dc1c92b48ca26256108bb49 100644 (file)
@@ -580,12 +580,13 @@ return rc;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-dnsdb_version_report(FILE *f)
+gstring *
+dnsdb_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: DNSDB: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: DNSDB: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index 2cf880ddae9758fa425a918e7b3cb4ea97ddae11..80000f14a3575e2ff92cb34045182961e386ef55 100644 (file)
@@ -158,12 +158,13 @@ handle = handle;   /* Avoid compiler warning */
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-dsearch_version_report(FILE *f)
+gstring *
+dsearch_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: dsearch: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: dsearch: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index defe5516e0563eb5d1ea4cafad80825d12977692..e1692992b85087b93f25788244cacb37ea2081f2 100644 (file)
@@ -548,12 +548,13 @@ static uschar *ibase_quote(uschar * s, uschar * opt)
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-ibase_version_report(FILE *f)
+gstring *
+ibase_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: ibase: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: ibase: Exim version %s\n", EXIM_VERSION_STR));
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index 3ca1af50d91f83c8c613a933ba2e4ac5edff34cf..7f2478b63045a3acf38108b7b47f4cf0b553b8fc 100644 (file)
@@ -158,10 +158,10 @@ json_close(void *handle)
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-json_version_report(FILE *f)
+gstring *
+json_version_report(gstring * g)
 {
 {
-fprintf(f, "Library version: json: Jansonn version %s\n", JANSSON_VERSION);
+return string_fmt_append(g, "Library version: json: Jansonn version %s\n", JANSSON_VERSION);
 }
 
 
 }
 
 
index b1958d2b2455c54976a4d7c84adde897431ac9b7..4152663586381e2212334a13f91c47d80b916954 100644 (file)
@@ -1558,12 +1558,13 @@ return quoted;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-ldap_version_report(FILE *f)
+gstring *
+ldap_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: LDAP: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: LDAP: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index b73ec1c4dd39256d1e23726f13dc9f908775fabf..a885badf11fcd6972309f0fdc1b29cb933f1afa2 100644 (file)
@@ -129,14 +129,16 @@ mdb_env_close(db_env);
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-lmdb_version_report(FILE * f)
+gstring *
+lmdb_version_report(BOOL is_stdout)
 {
 {
-fprintf(f, "Library version: LMDB: Compile: %d.%d.%d\n",
-    MDB_VERSION_MAJOR, MDB_VERSION_MINOR, MDB_VERSION_PATCH);
+gstring * g = string_fmt_append(g,
+                        "Library version: LMDB: Compile: %d.%d.%d\n",
+                         MDB_VERSION_MAJOR, MDB_VERSION_MINOR, MDB_VERSION_PATCH);
 #ifdef DYNLOOKUP
 #ifdef DYNLOOKUP
-fprintf(f, "                        Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "                        Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 static lookup_info lmdb_lookup_info = {
 }
 
 static lookup_info lmdb_lookup_info = {
index afb26908bcd6cd5a541a57d028e6831fb8e99e5a..562acdb662a6b15cd22e47c97f9c183b21db2f17 100644 (file)
@@ -416,12 +416,13 @@ lsearch_close(void *handle)
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-lsearch_version_report(FILE *f)
+gstring *
+lsearch_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: lsearch: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: lsearch: Exim version %s\n", EXIM_VERSION_STR));
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index b36ce0950f209c0c68ecb22e7b67c555df714984..782ad2a5fb1c73642ecb531064ef0f4148b6f060 100644 (file)
@@ -463,16 +463,19 @@ return quoted;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-mysql_version_report(FILE *f)
+gstring *
+mysql_version_report(gstring * g)
 {
 {
-fprintf(f, "Library version: MySQL: Compile: %lu %s [%s]\n"
-           "                        Runtime: %lu %s\n",
+g = string_fmt_append(g,
+  "Library version: MySQL: Compile: %lu %s [%s]\n"
+  "                        Runtime: %lu %s\n",
         (long)EXIM_MxSQL_VERSION_ID, EXIM_MxSQL_VERSION_STR, EXIM_MxSQL_BASE_STR,
         mysql_get_client_version(), mysql_get_client_info());
 #ifdef DYNLOOKUP
         (long)EXIM_MxSQL_VERSION_ID, EXIM_MxSQL_VERSION_STR, EXIM_MxSQL_BASE_STR,
         mysql_get_client_version(), mysql_get_client_info());
 #ifdef DYNLOOKUP
-fprintf(f, "                        Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g,
+  "                        Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 /* These are the lookup_info blocks for this driver */
 }
 
 /* These are the lookup_info blocks for this driver */
index 3747f83d4866b2cb576f0be54d8470c9970c6059..795da38915d3bef6ac256be307782fa2c008c2b3 100644 (file)
@@ -97,12 +97,13 @@ return (rc == YPERR_KEY || rc == YPERR_MAP)? FAIL : DEFER;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-nis_version_report(FILE *f)
+gstring *
+nis_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: NIS: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: NIS: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index 6a6aef570280afe94c9eeaab53bc1e48f102de97..dc3735b6bac7fe40846458011ed33d05bef015f0 100644 (file)
@@ -263,12 +263,13 @@ return quoted;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-nisplus_version_report(FILE *f)
+gstring *
+nisplus_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: NIS+: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: NIS+: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index 7c1e0b2058c2c85103575cc31a8dc9cea1534555..0429a8f8400439cba9809bc98810247124ef0114 100644 (file)
@@ -598,12 +598,13 @@ return quoted;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-oracle_version_report(FILE *f)
+gstring *
+oracle_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: Oracle: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: Oracle: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index f37bc6a0aad4de3d98aaac229b3dfa1baf3ecfa2..00e7548343f1fb16c9fa29ada89731b81b96d816 100644 (file)
@@ -54,12 +54,13 @@ return OK;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-passwd_version_report(FILE *f)
+gstring *
+passwd_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: passwd: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: passwd: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 static lookup_info _lookup_info = {
 }
 
 static lookup_info _lookup_info = {
index 28d4024d8a385b444ea6c0ce93e8849dd12d4e1d..c3053430e531d2880385d27e5556c6ede1ee9cb4 100644 (file)
@@ -467,11 +467,11 @@ return quoted;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-pgsql_version_report(FILE *f)
+gstring *
+pgsql_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: PostgreSQL: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: PostgreSQL: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 
 /* Version reporting: there appears to be no available information about
 #endif
 
 /* Version reporting: there appears to be no available information about
@@ -479,6 +479,8 @@ the client library in libpq-fe.h; once you have a connection object, you
 can access the server version and the chosen protocol version, but those
 aren't really what we want.  It might make sense to debug_printf those
 when the connection is established though? */
 can access the server version and the chosen protocol version, but those
 aren't really what we want.  It might make sense to debug_printf those
 when the connection is established though? */
+
+return g;
 }
 
 
 }
 
 
index 9146cba7668135a85883b2d5a68e2f035fde0760..0bc506093f79c6a2ce5016101d5af54803e51718 100644 (file)
@@ -435,14 +435,16 @@ return quoted;
 *************************************************/
 #include "../version.h"
 
 *************************************************/
 #include "../version.h"
 
-void
-redis_version_report(FILE *f)
+gstring *
+redis_version_report(gstring * g)
 {
 {
-fprintf(f, "Library version: REDIS: Compile: %d [%d]\n",
-               HIREDIS_MAJOR, HIREDIS_MINOR);
+g = string_fmt_append(g,
+  "Library version: REDIS: Compile: %d [%d]\n", HIREDIS_MAJOR, HIREDIS_MINOR);
 #ifdef DYNLOOKUP
 #ifdef DYNLOOKUP
-fprintf(f, "                        Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g,
+  "                        Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index 179b3a648d1d1b123d27908d5e35eaadf92df0bd..9be118183975d7107662e961f508f3c0981a4a54 100644 (file)
@@ -128,12 +128,13 @@ return OK;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-spf_version_report(FILE *f)
+gstring *
+spf_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: SPF: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: SPF: Exim version %s\n", EXIM_VERSION_STR));
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index d8a11ba1294897001964023c4cafb644381a049b..65e7cffc9e89e5dcb2a51ce7e7b3228d60fe12c0 100644 (file)
@@ -165,15 +165,18 @@ return quoted;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-sqlite_version_report(FILE *f)
+gstring *
+sqlite_version_report(gstring * g)
 {
 {
-fprintf(f, "Library version: SQLite: Compile: %s\n"
-           "                         Runtime: %s\n",
+g = string_fmt_append(g,
+  "Library version: SQLite: Compile: %s\n"
+  "                         Runtime: %s\n",
         SQLITE_VERSION, sqlite3_libversion());
 #ifdef DYNLOOKUP
         SQLITE_VERSION, sqlite3_libversion());
 #ifdef DYNLOOKUP
-fprintf(f, "                         Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g,
+  "                         Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 static lookup_info _lookup_info = {
 }
 
 static lookup_info _lookup_info = {
index b169b059a2c08e7e216a037de5cfb3bea2e35c6e..04c1310af4fe44ecf00901a73f40b97034436571 100644 (file)
@@ -68,12 +68,13 @@ return OK;
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-testdb_version_report(FILE *f)
+gstring *
+testdb_version_report(gstring * g)
 {
 #ifdef DYNLOOKUP
 {
 #ifdef DYNLOOKUP
-fprintf(f, "Library version: TestDB: Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, "Library version: TestDB: Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 
 }
 
 
index 15ff3cf02527de37c1f965656dfe1f6445960b44..cbcf45b7cc279565a8796ef588bd6aea4db8080b 100644 (file)
@@ -64,13 +64,16 @@ switch (wso_query(CS query, CS buffer, sizeof(buffer)))
 
 #include "../version.h"
 
 
 #include "../version.h"
 
-void
-whoson_version_report(FILE *f)
+gstring *
+whoson_version_report(gstring * g)
 {
 {
-fprintf(f, "Library version: Whoson: Runtime: %s\n", wso_version());
+g = string_fmt_append(g,
+  "Library version: Whoson: Runtime: %s\n", wso_version());
 #ifdef DYNLOOKUP
 #ifdef DYNLOOKUP
-fprintf(f, "                         Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g,
+  "                         Exim version %s\n", EXIM_VERSION_STR);
 #endif
 #endif
+return g;
 }
 
 static lookup_info _lookup_info = {
 }
 
 static lookup_info _lookup_info = {
index 9f0805ada9d49ac93ad36356c4e08ad015282f4b..e3df789fb577d878bc6bd69d8d5de9e69ad23edd 100644 (file)
@@ -34,15 +34,17 @@ SPF_response_t  *spf_response_2mx = NULL;
 SPF_dns_rr_t  * spf_nxdomain = NULL;
 
 
 SPF_dns_rr_t  * spf_nxdomain = NULL;
 
 
-void
-spf_lib_version_report(FILE * fp)
+gstring *
+spf_lib_version_report(gstring * g)
 {
 int maj, min, patch;
 {
 int maj, min, patch;
+
 SPF_get_lib_version(&maj, &min, &patch);
 SPF_get_lib_version(&maj, &min, &patch);
-fprintf(fp, "Library version: spf2: Compile: %d.%d.%d\n",
+g = string_fmt_append(g, "Library version: spf2: Compile: %d.%d.%d\n",
        SPF_LIB_VERSION_MAJOR, SPF_LIB_VERSION_MINOR, SPF_LIB_VERSION_PATCH);
        SPF_LIB_VERSION_MAJOR, SPF_LIB_VERSION_MINOR, SPF_LIB_VERSION_PATCH);
-fprintf(fp, "                       Runtime: %d.%d.%d\n",
+g = string_fmt_append(g,    "                       Runtime: %d.%d.%d\n",
         maj, min, patch);
         maj, min, patch);
+return g;
 }
 
 
 }
 
 
index 114ef3b977ec3ddd34fd22552f3340ca788bebe0..7148babedb0272fb7af2462446bf0e9650f43c16 100644 (file)
@@ -25,7 +25,7 @@ typedef struct spf_result_id {
 } spf_result_id;
 
 /* prototypes */
 } spf_result_id;
 
 /* prototypes */
-void spf_lib_version_report(FILE *);
+gstring * spf_lib_version_report(gstring *);
 BOOL spf_init(void);
 BOOL spf_conn_init(uschar *, uschar *);
 int  spf_process(const uschar **, uschar *, int);
 BOOL spf_init(void);
 BOOL spf_conn_init(uschar *, uschar *);
 int  spf_process(const uschar **, uschar *, int);
index eee288efde8415d5be784ae8ff20e27810669443..a6ba95f95ce5db315f896840357e60a779ecd5e4 100644 (file)
@@ -435,8 +435,8 @@ typedef struct auth_info {
     int,                          /* command timeout */
     uschar *,                     /* buffer for reading response */
     int);                         /* sizeof buffer */
     int,                          /* command timeout */
     uschar *,                     /* buffer for reading response */
     int);                         /* sizeof buffer */
-  void (*version_report)(         /* diagnostic version reporting */
-    FILE *);                      /* I/O stream to print to */
+  gstring * (*version_report)(    /* diagnostic version reporting */
+    gstring *);                   /* string to append to */
   void (*macros_create)(void);   /* feature-macro creation */
 } auth_info;
 
   void (*macros_create)(void);   /* feature-macro creation */
 } auth_info;
 
index 3adadb80bea3d513b3705dc6493df4b58a4f72ed..a6eaa88b91373421669c8d02857aafebdd22247b 100644 (file)
@@ -4234,17 +4234,18 @@ return NULL;
 
 /* See a description in tls-openssl.c for an explanation of why this exists.
 
 
 /* See a description in tls-openssl.c for an explanation of why this exists.
 
-Arguments:   a FILE* to print the results to
-Returns:     nothing
+Arguments:   string to append to
+Returns:     string
 */
 
 */
 
-void
-tls_version_report(FILE *f)
+gstring *
+tls_version_report(gstring * g)
 {
 {
-fprintf(f, "Library version: GnuTLS: Compile: %s\n"
-           "                         Runtime: %s\n",
-           LIBGNUTLS_VERSION,
-           gnutls_check_version(NULL));
+return string_fmt_append(g,
+    "Library version: GnuTLS: Compile: %s\n"
+    "                         Runtime: %s\n",
+            LIBGNUTLS_VERSION,
+            gnutls_check_version(NULL));
 }
 
 #endif /*!MACRO_PREDEF*/
 }
 
 #endif /*!MACRO_PREDEF*/
index a16e58791a751df9aeee33d499c5edee60422992..26279848653bea2c964432fa32bd2b8b5e1b0263 100644 (file)
@@ -4638,21 +4638,22 @@ number/string, and the version date remains unchanged.  The _build_ date
 will change, so we can more usefully assist with version diagnosis by also
 reporting the build date.
 
 will change, so we can more usefully assist with version diagnosis by also
 reporting the build date.
 
-Arguments:   a FILE* to print the results to
-Returns:     nothing
+Arguments:   string to append to
+Returns:     string
 */
 
 */
 
-void
-tls_version_report(FILE *f)
+gstring *
+tls_version_report(gstring * g)
 {
 {
-fprintf(f, "Library version: OpenSSL: Compile: %s\n"
-           "                          Runtime: %s\n"
-           "                                 : %s\n",
-           OPENSSL_VERSION_TEXT,
-           SSLeay_version(SSLEAY_VERSION),
-           SSLeay_version(SSLEAY_BUILT_ON));
-/* third line is 38 characters for the %s and the line is 73 chars long;
-the OpenSSL output includes a "built on: " prefix already. */
+return string_fmt_append(g,
+    "Library version: OpenSSL: Compile: %s\n"
+    "                          Runtime: %s\n"
+    "                                 : %s\n",
+            OPENSSL_VERSION_TEXT,
+            SSLeay_version(SSLEAY_VERSION),
+            SSLeay_version(SSLEAY_BUILT_ON));
+  /* third line is 38 characters for the %s and the line is 73 chars long;
+  the OpenSSL output includes a "built on: " prefix already. */
 }
 
 
 }
 
 
index 2bc81e839cfa235b39137360484b1f787aaef5ee..f035dafd042c2e6c16603d5e9eac4b067e415a6d 100644 (file)
@@ -245,28 +245,29 @@ return l;
 
 /* See a description in tls-openssl.c for an explanation of why this exists.
 
 
 /* See a description in tls-openssl.c for an explanation of why this exists.
 
-Arguments:   a FILE* to print the results to
-Returns:     nothing
+Arguments:   string to append to
+Returns:     string
 */
 
 */
 
-void
-utf8_version_report(FILE *f)
+gstring *
+utf8_version_report(gstring * g)
 {
 #ifdef SUPPORT_I18N_2008
 {
 #ifdef SUPPORT_I18N_2008
-fprintf(f, "Library version: IDN2: Compile: %s\n"
+g = string_fmt_append(g, "Library version: IDN2: Compile: %s\n"
            "                       Runtime: %s\n",
        IDN2_VERSION,
        idn2_check_version(NULL));
            "                       Runtime: %s\n",
        IDN2_VERSION,
        idn2_check_version(NULL));
-fprintf(f, "Library version: Stringprep: Compile: %s\n"
+g = string_fmt_append(g, "Library version: Stringprep: Compile: %s\n"
            "                             Runtime: %s\n",
        STRINGPREP_VERSION,
        stringprep_check_version(NULL));
 #else
            "                             Runtime: %s\n",
        STRINGPREP_VERSION,
        stringprep_check_version(NULL));
 #else
-fprintf(f, "Library version: IDN: Compile: %s\n"
+g = string_fmt_append(g, "Library version: IDN: Compile: %s\n"
            "                      Runtime: %s\n",
        STRINGPREP_VERSION,
        stringprep_check_version(NULL));
 #endif
            "                      Runtime: %s\n",
        STRINGPREP_VERSION,
        stringprep_check_version(NULL));
 #endif
+return g;
 }
 
 #endif /* whole file */
 }
 
 #endif /* whole file */
index 10f5e441582d1f844fa68ae68acf0d5c27f3e880..ede05bea84cfdabc6658cd29d02538ad133800b6 100755 (executable)
@@ -1117,28 +1117,28 @@ RESET_AFTER_EXTRA_LINE_READ:
     next if /^TLS: not preloading server certs$/;
 
     # drop lookups
     next if /^TLS: not preloading server certs$/;
 
     # drop lookups
-    next if /^Lookups \(built-in\):/;
-    next if /^Loading lookup modules from/;
-    next if /^Loaded \d+ lookup modules/;
-    next if /^(?:\d\d:\d\d:\d\d \d+ )?Total \d+ lookups/;
+    next if /^(?:\d\d:\d\d:\d\d\ \d+\ )?(?: Lookups\ \(built-in\):
+                                       | Loading\ lookup\ modules\ from
+                                       | Loaded\ \d+\ lookup\ modules
+                                       | Total\ \d+\ lookups)/x;
 
     # drop compiler information
 
     # drop compiler information
-    next if /^Compiler:/;
+    next if /^(?:\d\d:\d\d:\d\d \d+ )?Compiler:/;
 
     # and the ugly bit
     # different libraries will have different numbers (possibly 0) of follow-up
     # lines, indenting with more data
 
     # and the ugly bit
     # different libraries will have different numbers (possibly 0) of follow-up
     # lines, indenting with more data
-    if (/^Library version:/) {
+    if (/^(?:\d\d:\d\d:\d\d \d+ )?Library version:/) {
       while (1) {
        $_ = <IN>;
       while (1) {
        $_ = <IN>;
-       next if /^\s/;
+       next if /^(?:\d\d:\d\d:\d\d \d+ )?\s/;
        goto RESET_AFTER_EXTRA_LINE_READ;
       }
     }
 
     # drop other build-time controls emitted for debugging
        goto RESET_AFTER_EXTRA_LINE_READ;
       }
     }
 
     # drop other build-time controls emitted for debugging
-    next if /^WHITELIST_D_MACROS:/;
-    next if /^TRUSTED_CONFIG_LIST:/;
+    next if /^(?:\d\d:\d\d:\d\d \d+ )?WHITELIST_D_MACROS:/;
+    next if /^(?:\d\d:\d\d:\d\d \d+ )?TRUSTED_CONFIG_LIST:/;
 
     # As of Exim 4.74, we log when a setgid fails; because we invoke Exim
     # with -be, privileges will have been dropped, so this will always
 
     # As of Exim 4.74, we log when a setgid fails; because we invoke Exim
     # with -be, privileges will have been dropped, so this will always
@@ -1441,20 +1441,23 @@ RESET_AFTER_EXTRA_LINE_READ:
       # because they will be different in different binaries.
 
       print MUNGED
       # because they will be different in different binaries.
 
       print MUNGED
-        unless (/^Berkeley DB: / ||
-                /^Probably (?:Berkeley DB|ndbm|GDBM)/ ||
-                /^Authenticators:/ ||
-                /^Lookups:/ ||
-                /^Support for:/ ||
-                /^Routers:/ ||
-                /^Transports:/ ||
-                /^Malware:/ ||
-                /^(?:\d\d:\d\d:\d\d \d+ )?log selectors =/ ||
-                /^cwd=/ ||
-                /^Fixed never_users:/ ||
-               /^Configure owner:/ ||
-                /^Size of off_t:/
-                );
+        unless (/^(?:\d\d:\d\d:\d\d\ \d+\ )?
+                 (?: Berkeley\ DB:\s
+                   | Probably\ (?:Berkeley\ DB|ndbm|GDBM)
+                   | Authenticators:
+                   | Lookups(?:\(built-in\))?:
+                   | Support\ for:
+                   | Routers:
+                   | Transports:
+                   | Malware:
+                   | log\ selectors\ =
+                   | cwd=
+                   | Fixed\ never_users
+                   | Configure\ owner
+                   | Size\ of\ off_t:
+                 )
+               /x
+               );
 
 
       }
 
 
       }
index 4700343ef8e465bf43d5e500a95ac86dbe5ca10d..ab3ddcb3b67b516d6ce879d88527ee0e5b6639e8 100644 (file)
@@ -27,7 +27,6 @@
 01:01:01 1237   uid=uuuu gid=EXIM_GID pid=pppp
 01:01:01 1237 adding SSLKEYLOGFILE=TESTSUITE/spool/sslkeys
 01:01:01 1237 configuration file is TESTSUITE/test-config
 01:01:01 1237   uid=uuuu gid=EXIM_GID pid=pppp
 01:01:01 1237 adding SSLKEYLOGFILE=TESTSUITE/spool/sslkeys
 01:01:01 1237 configuration file is TESTSUITE/test-config
-01:01:01 1237 cwd=TESTSUITE/spool 10 args: TESTSUITE/eximdir/exim -DEXIM_PATH=TESTSUITE/eximdir/exim -DSERVER=server -C TESTSUITE/test-config -d=0xfff9ffff -MCd daemon-accept-delivery -Mc 10HmaX-0005vi-00
 01:01:01 1237 trusted user
 01:01:01 1237 admin user
 01:01:01 1237 dropping to exim gid; retaining priv uid
 01:01:01 1237 trusted user
 01:01:01 1237 admin user
 01:01:01 1237 dropping to exim gid; retaining priv uid