Skip to content
Snippets Groups Projects
Commit d174f672 authored by Luke Howard's avatar Luke Howard
Browse files

Add read-only SLAPI_X_ADD_STRUCTURAL_CLASS pblock extension.

This is necessary to compensate for a regression in the SLAPI
implementation since it moved to an overlay: global add preop
plugins no longer have access to operational attributes,
because slap_mods_opattrs() is called by fe_op_add(), invoked
after the global SLAPI overlay.

(Some of our plugins need to the structural object class of the
to-be-added entry.)

I suppose an option would be to have the SLAPI overlay
optimistically call slap_mods_opattrs() (as long as this can be
called idempotently). If there are any other ideas let me know.
parent 9f865579
No related branches found
No related tags found
No related merge requests found
......@@ -277,6 +277,7 @@ pblock_get_param_class( int param )
case SLAPI_X_GROUP_ATTRIBUTE:
case SLAPI_X_GROUP_OPERATION_DN:
case SLAPI_X_GROUP_TARGET_ENTRY:
case SLAPI_X_ADD_STRUCTURAL_CLASS:
case SLAPI_PLUGIN_AUDIT_DATA:
case SLAPI_IBM_PBLOCK:
case SLAPI_PLUGIN_VERSION:
......@@ -472,6 +473,20 @@ pblock_get( Slapi_PBlock *pb, int param, void **value )
PBLOCK_ASSERT_OP( pb, 0 );
*((int *)value) = get_no_schema_check( pb->pb_op );
break;
case SLAPI_X_ADD_STRUCTURAL_CLASS:
PBLOCK_ASSERT_OP( pb, 0 );
if ( pb->pb_op->o_tag == LDAP_REQ_ADD ) {
struct berval tmpval = BER_BVNULL;
rc = mods_structural_class( pb->pb_op->ora_modlist,
&tmpval, &pb->pb_rs->sr_text,
pb->pb_textbuf, sizeof( pb->pb_textbuf ));
*((char **)value) = tmpval.bv_val;
} else {
rc = PBLOCK_ERROR;
}
break;
case SLAPI_REQCONTROLS:
PBLOCK_ASSERT_OP( pb, 0 );
*((LDAPControl ***)value) = pb->pb_op->o_ctrls;
......@@ -1203,6 +1218,7 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
case SLAPI_X_CONN_CLIENTPATH:
case SLAPI_CONN_SERVERIP:
case SLAPI_X_CONN_SERVERPATH:
case SLAPI_X_ADD_STRUCTURAL_CLASS:
/* These parameters cannot be set */
rc = PBLOCK_ERROR;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment