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.

[1791 byte] By [dkichlinea] at [2007-11-27 8:34:19]
# 1

The replacement is the one you mention. But the sample replacement code you've posted here do not reference the same set of modifications.

Do you get an error when calling slapi_modify_internal_set_pb ?

Do you get an error when calling slapi_modify_internal_pb ?

Any additional information in the errors' log ?

Regards,

Ludovic.

ludovicpa at 2007-7-12 20:30:32 > top of Java-index,Web & Directory Servers,Directory Servers...