From 684296c6693031350a91b342af117049fb5375ec Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@openldap.org>
Date: Thu, 15 Nov 2007 01:56:07 +0000
Subject: [PATCH] Fix rev 1.266, was creating {0}config entry prematurely.

---
 servers/slapd/bconfig.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c
index a0fa915259..4564a6f503 100644
--- a/servers/slapd/bconfig.c
+++ b/servers/slapd/bconfig.c
@@ -5943,6 +5943,7 @@ config_tool_entry_put( BackendDB *be, Entry *e, struct berval *text )
 	Connection conn = {0};
 	Operation *op = NULL;
 	void *thrctx;
+	int isFrontend = 0;
 
 	/* Create entry for frontend database if it does not exist already */
 	if ( !entry_put_got_frontend ) {
@@ -5992,11 +5993,12 @@ config_tool_entry_put( BackendDB *be, Entry *e, struct berval *text )
 				}
 			} else {
 				entry_put_got_frontend++;
+				isFrontend = 1;
 			}
 		}
 	}
 	/* Create entry for config database if it does not exist already */
-	if ( !entry_put_got_config ) {
+	if ( !entry_put_got_config && !isFrontend ) {
 		if ( !strncmp( e->e_nname.bv_val, "olcDatabase",
 				STRLENOF( "olcDatabase" ))) {
 			if ( strncmp( e->e_nname.bv_val +
-- 
GitLab