andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From ac613f043328a027c13bdc24965062734d56002c Mon Sep 17 00:00:00 2001
dc8c34
From: Mark Reynolds <mreynolds@redhat.com>
dc8c34
Date: Mon, 7 Jan 2013 14:55:29 -0500
dc8c34
Subject: [PATCH] Ticket 495 - 1.2.11 - plugin dn is missing from pblock
dc8c34
dc8c34
Bug Description:  on 1.2.11 when setting the backend in the pblock we do not
dc8c34
                  set the plugin dn if its missing.  This causes inconsistencies
dc8c34
                  with internalModifiersname and internalcreatorsname.
dc8c34
dc8c34
Fix description:  Set the plugin dn of the plugin if it is missing when setting the
dc8c34
                  backend in the pblock.
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/495
dc8c34
dc8c34
Reviewed by: ?
dc8c34
(cherry picked from commit d47fd4bc965e597c8d27368aa546d4012ce2546e)
dc8c34
---
dc8c34
 ldap/servers/slapd/pblock.c | 4 ++++
dc8c34
 1 file changed, 4 insertions(+)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
dc8c34
index 33559a7..1d1db1e 100644
dc8c34
--- a/ldap/servers/slapd/pblock.c
dc8c34
+++ b/ldap/servers/slapd/pblock.c
dc8c34
@@ -1966,6 +1966,10 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value )
dc8c34
 	switch ( arg ) {
dc8c34
 	case SLAPI_BACKEND:
dc8c34
 		pblock->pb_backend = (Slapi_Backend *) value;
dc8c34
+		if (pblock->pb_backend && (NULL == pblock->pb_plugin)) {
dc8c34
+			/* newly allocated pblock may not have backend plugin set. */
dc8c34
+			pblock->pb_plugin = (struct slapdplugin *)pblock->pb_backend->be_database;
dc8c34
+		}
dc8c34
 		break;
dc8c34
 	case SLAPI_BACKEND_COUNT:
dc8c34
 		pblock->pb_backend_count = *((int *) value);
dc8c34
-- 
dc8c34
1.7.11.7
dc8c34