andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
Blob Blame History Raw
From ac613f043328a027c13bdc24965062734d56002c Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Mon, 7 Jan 2013 14:55:29 -0500
Subject: [PATCH] Ticket 495 - 1.2.11 - plugin dn is missing from pblock

Bug Description:  on 1.2.11 when setting the backend in the pblock we do not
                  set the plugin dn if its missing.  This causes inconsistencies
                  with internalModifiersname and internalcreatorsname.

Fix description:  Set the plugin dn of the plugin if it is missing when setting the
                  backend in the pblock.

https://fedorahosted.org/389/ticket/495

Reviewed by: ?
(cherry picked from commit d47fd4bc965e597c8d27368aa546d4012ce2546e)
---
 ldap/servers/slapd/pblock.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index 33559a7..1d1db1e 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -1966,6 +1966,10 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value )
 	switch ( arg ) {
 	case SLAPI_BACKEND:
 		pblock->pb_backend = (Slapi_Backend *) value;
+		if (pblock->pb_backend && (NULL == pblock->pb_plugin)) {
+			/* newly allocated pblock may not have backend plugin set. */
+			pblock->pb_plugin = (struct slapdplugin *)pblock->pb_backend->be_database;
+		}
 		break;
 	case SLAPI_BACKEND_COUNT:
 		pblock->pb_backend_count = *((int *) value);
-- 
1.7.11.7