From 96508de1f4e018efe8bd22e857cde2e5d8541f69 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Wed, 17 Jan 2018 11:46:01 +0000 Subject: [PATCH] DB: show the Berkeley DB runtime library version, for "-d -bV" --- doc/doc-txt/ChangeLog | 3 +++ src/src/exim.c | 40 +++++++++++++++++++++++++++++----------- test/runtest | 1 + 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 2c2448537..88f113cc4 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -58,6 +58,9 @@ JH/09 The "aveserver", "kavdaemon" and "mksd" interfaces are now not included JH/10 Bug 2223: Fix mysql lookup returns for the no-data case (when the number of rows affected is given instead). +JH/11 The runtime Berkeley DB library version is now additionally output by + "exim -d -bV". Previously only the compile-time version was shown. + Exim version 4.90 ----------------- diff --git a/src/src/exim.c b/src/src/exim.c index 01c0e306a..d8411082a 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -743,26 +743,26 @@ else * Show supported features * *************************************************/ -/* 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 -Returns: nothing -*/ - static void -show_whats_supported(FILE *f) +show_db_version(FILE * f) { - auth_info *authi; - #ifdef DB_VERSION_STRING -fprintf(f, "Berkeley DB: %s\n", DB_VERSION_STRING); +DEBUG(D_any) + { + fprintf(f, "Library version: BDB: Compile: %s\n", DB_VERSION_STRING); + fprintf(f, " Runtime: %s\n", + db_version(NULL, NULL, NULL)); + } +else + fprintf(f, "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 + #elif defined(_DBM_RDONLY) || defined(dbm_dirfno) fprintf(f, "Probably ndbm\n"); #elif defined(USE_TDB) @@ -774,6 +774,22 @@ fprintf(f, "Using tdb\n"); fprintf(f, "Probably GDBM (compatibility mode)\n"); #endif #endif +} + + +/* 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 +Returns: nothing +*/ + +static void +show_whats_supported(FILE * f) +{ +auth_info * authi; + +DEBUG(D_any) {} else show_db_version(f); fprintf(f, "Support for:"); #ifdef SUPPORT_CRYPTEQ @@ -980,6 +996,8 @@ DEBUG(D_any) do { gnu_get_libc_version()); #endif +show_db_version(f); + #ifdef SUPPORT_TLS tls_version_report(f); #endif diff --git a/test/runtest b/test/runtest index a6844bebb..89625e90d 100755 --- a/test/runtest +++ b/test/runtest @@ -2783,6 +2783,7 @@ while () my(@temp); if (/^(Exim|Library) version/) { print; } + if (/Runtime: /) {print; } elsif (/^Size of off_t: (\d+)/) { -- 2.30.2