Upgrading to DS 5.2
We are in the process of upgrading to DS 5.2. One of my tasks is to take a Post-Op plugin and install it on the new server.
The issue I am encountering is that there is a deprecated api call and I am not sure how to use its' replacement. The deprecated call is slapi_modify_internal(). I am trying to use slapi_modify_internal_set_pb.
Here is the original
int iLogChange= 1;
int iModRes= LDAP_SUCCESS;
Slapi_PBlock* pNewBlock = NULL;
LDAPMod oAttrib1;
LDAPMod* pListOfAttribs[2];
char* pNewObj;
char* pObjValues[] ={ pObjClassName, NULL};
oAttrib1.mod_op = LDAP_MOD_ADD;
oAttrib1.mod_type ="objectclass";
oAttrib1.mod_values = pObjValues;
pListOfAttribs[0] = &oAttrib1;
pListOfAttribs[1] = NULL;
pNewBlock = slapi_modify_internal( normalized_dn, pListOfAttribs,
NULL, iLogChange );
slapi_pblock_get( pNewBlock, SLAPI_PLUGIN_INTOP_RESULT, &iModRes );
if ( LDAP_SUCCESS != iModRes ){
return(-1);
}// end if
The proposed new code that does not seem to work:
Slapi_PBlock* newpb = slapi_pblock_new();
rc = slapi_modify_internal_set_pb(newpb, normalized_dn, ldapModArray, NULL, NULL, getPluginIdentification(), SLAPI_OP_FLAG_NEVER_CHAIN );
slapi_modify_internal_pb(newpb);
slapi_pblock_get( newpb, SLAPI_PLUGIN_INTOP_RESULT, &rc );
The changes do not take affect though.
Thanks for any help you can provide.

