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*/
* 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);
-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);
+return g;
}
/*************************************************
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 */
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)
* 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));
}
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 */
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*/
* 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. */
-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*/
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 */
};
-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));
}
# 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();
* 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)
{
- 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
- 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)
- #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)
-fprintf(f, "Probably ndbm\n");
+g = string_cat(g, US"Probably ndbm\n");
#elif defined(USE_TDB)
-fprintf(f, "Using tdb\n");
+g = string_cat(g, US"Using tdb\n");
#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
+return g;
}
/* 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
-show_whats_supported(FILE * fp)
+show_whats_supported(BOOL is_stdout)
{
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 WITH_CONTENT_SCAN
g = malware_show_supported(g);
#endif
+show_string(is_stdout, g); g = NULL;
if (fixed_never_users[0] > 0)
{
}
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. */
-DEBUG(D_any) do {
+DEBUG(D_any)
+ {
/* 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__)
- fprintf(fp, "Compiler: GCC [%s]\n",
+ g = string_fmt_append(g, "Compiler: GCC [%s]\n",
# ifdef __VERSION__
__VERSION__
# else
# endif
);
#else
- fprintf(fp, "Compiler: <unknown>\n");
+ g = string_cat(g, US"Compiler: <unknown>\n");
#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))
- fprintf(fp, " Runtime: %s\n",
+ g = string_fmt_append(g, " Runtime: %s\n",
gnu_get_libc_version());
#endif
-show_db_version(fp);
+g = show_db_version(g);
#ifndef DISABLE_TLS
- tls_version_report(fp);
+ g = tls_version_report(g);
#endif
#ifdef SUPPORT_I18N
- utf8_version_report(fp);
+ g = utf8_version_report(g);
#endif
#ifdef SUPPORT_DMARC
- dmarc_version_report(fp);
+ g = dmarc_version_report(g);
#endif
#ifdef SUPPORT_SPF
- spf_lib_version_report(fp);
+ g = spf_lib_version_report(g);
#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
{
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) "",
#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
- fprintf(fp, "WHITELIST_D_MACROS: \"%s\"\n", WHITELIST_D_MACROS);
+ g = string_fmt_append(g, "WHITELIST_D_MACROS: \"%s\"\n", WHITELIST_D_MACROS);
#else
- fprintf(fp, "WHITELIST_D_MACROS unset\n");
+ g = string_cat(g, US"WHITELIST_D_MACROS unset\n");
#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
- fprintf(fp, "TRUSTED_CONFIG_LIST unset\n");
+ g = string_cat(g, US"TRUSTED_CONFIG_LIST unset\n");
#endif
+ }
-} while (0);
+show_string(is_stdout, g);
store_reset(reset_point);
}
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;
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);
}
}
#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);
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 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,
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
#include "../version.h"
-void
-cdb_version_report(FILE *f)
+gstring *
+cdb_version_report(gstring * g)
{
#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
+return g;
}
#include "../version.h"
-void
-dbm_version_report(FILE *f)
+gstring *
+dbm_version_report(gstring * g)
{
#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
+return g;
}
#include "../version.h"
-void
-dnsdb_version_report(FILE *f)
+gstring *
+dnsdb_version_report(gstring * g)
{
#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
+return g;
}
#include "../version.h"
-void
-dsearch_version_report(FILE *f)
+gstring *
+dsearch_version_report(gstring * g)
{
#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
+return g;
}
#include "../version.h"
-void
-ibase_version_report(FILE *f)
+gstring *
+ibase_version_report(gstring * g)
{
#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
+return g;
}
#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);
}
#include "../version.h"
-void
-ldap_version_report(FILE *f)
+gstring *
+ldap_version_report(gstring * g)
{
#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
+return g;
}
#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
-fprintf(f, " Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g, " Exim version %s\n", EXIM_VERSION_STR);
#endif
+return g;
}
static lookup_info lmdb_lookup_info = {
#include "../version.h"
-void
-lsearch_version_report(FILE *f)
+gstring *
+lsearch_version_report(gstring * g)
{
#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
+return g;
}
#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
-fprintf(f, " Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g,
+ " Exim version %s\n", EXIM_VERSION_STR);
#endif
+return g;
}
/* These are the lookup_info blocks for this driver */
#include "../version.h"
-void
-nis_version_report(FILE *f)
+gstring *
+nis_version_report(gstring * g)
{
#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
+return g;
}
#include "../version.h"
-void
-nisplus_version_report(FILE *f)
+gstring *
+nisplus_version_report(gstring * g)
{
#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
+return g;
}
#include "../version.h"
-void
-oracle_version_report(FILE *f)
+gstring *
+oracle_version_report(gstring * g)
{
#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
+return g;
}
#include "../version.h"
-void
-passwd_version_report(FILE *f)
+gstring *
+passwd_version_report(gstring * g)
{
#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
+return g;
}
static lookup_info _lookup_info = {
#include "../version.h"
-void
-pgsql_version_report(FILE *f)
+gstring *
+pgsql_version_report(gstring * g)
{
#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
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;
}
*************************************************/
#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
-fprintf(f, " Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g,
+ " Exim version %s\n", EXIM_VERSION_STR);
#endif
+return g;
}
#include "../version.h"
-void
-spf_version_report(FILE *f)
+gstring *
+spf_version_report(gstring * g)
{
#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
+return g;
}
#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
-fprintf(f, " Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g,
+ " Exim version %s\n", EXIM_VERSION_STR);
#endif
+return g;
}
static lookup_info _lookup_info = {
#include "../version.h"
-void
-testdb_version_report(FILE *f)
+gstring *
+testdb_version_report(gstring * g)
{
#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
+return g;
}
#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
-fprintf(f, " Exim version %s\n", EXIM_VERSION_STR);
+g = string_fmt_append(g,
+ " Exim version %s\n", EXIM_VERSION_STR);
#endif
+return g;
}
static lookup_info _lookup_info = {
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;
+
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);
-fprintf(fp, " Runtime: %d.%d.%d\n",
+g = string_fmt_append(g, " Runtime: %d.%d.%d\n",
maj, min, patch);
+return g;
}
} 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);
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;
/* 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*/
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. */
}
/* 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
-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));
-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
-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
+return g;
}
#endif /* whole file */
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
- 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
- if (/^Library version:/) {
+ if (/^(?:\d\d:\d\d:\d\d \d+ )?Library version:/) {
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
- 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
# 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
+ );
}
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