From 9198281e9e061eecea0da35cc36fd53c1cd3dc48 Mon Sep 17 00:00:00 2001
From: Kurt Zeilenga <kurt@openldap.org>
Date: Sun, 20 Mar 2005 17:18:15 +0000
Subject: [PATCH] db mismatch (including patch mismatch) should be an error

---
 servers/slapd/back-bdb/init.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c
index 99afed49b0..f66f1fd690 100644
--- a/servers/slapd/back-bdb/init.c
+++ b/servers/slapd/back-bdb/init.c
@@ -507,12 +507,14 @@ bdb_back_initialize(
 #endif
 
 		ver = (major << 24) | (minor << 16) | patch;
-		if( ver < DB_VERSION_FULL ) {
-			Debug( LDAP_DEBUG_TRACE,
+		if( ver != DB_VERSION_FULL ) {
+			/* fail if a versions don't match */
+			Debug( LDAP_DEBUG_ANY,
 				LDAP_XSTRING(bdb_back_initialize) ": "
 				"BDB library version mismatch:"
 				" expected " DB_VERSION_STRING ","
 				" got %s\n", version, 0, 0 );
+			return -1;
 		}
 
 		Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_back_initialize)
-- 
GitLab