mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Allow SLAPI plug-ins to override OpenLDAP extended operations
(please review)
This commit is contained in:
parent
009191da73
commit
1251d801c1
@ -242,35 +242,7 @@ do_extended(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LDAP_SLAPI)
|
#if defined(LDAP_SLAPI)
|
||||||
if (ext != NULL) { /* OpenLDAP extended operation */
|
if ( funcAddr != NULL ) {
|
||||||
#endif /* defined(LDAP_SLAPI) */
|
|
||||||
|
|
||||||
if (reqdata.bv_val) op->ore_reqdata = &reqdata;
|
|
||||||
rs->sr_err = (ext->ext_main)( op, rs );
|
|
||||||
|
|
||||||
if( rs->sr_err != SLAPD_ABANDON ) {
|
|
||||||
if ( rs->sr_err == LDAP_REFERRAL && rs->sr_ref == NULL ) {
|
|
||||||
rs->sr_ref = referral_rewrite( default_referral,
|
|
||||||
NULL, NULL, LDAP_SCOPE_DEFAULT );
|
|
||||||
}
|
|
||||||
|
|
||||||
send_ldap_extended( op, rs );
|
|
||||||
|
|
||||||
ber_bvarray_free( rs->sr_ref );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( rs->sr_rspoid != NULL ) {
|
|
||||||
free( (char *)rs->sr_rspoid );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( rs->sr_rspdata != NULL ) {
|
|
||||||
ber_bvfree( rs->sr_rspdata );
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined( LDAP_SLAPI )
|
|
||||||
goto done; /* end of OpenLDAP extended operation */
|
|
||||||
|
|
||||||
} else { /* start of Netscape extended operation */
|
|
||||||
rs->sr_err = slapi_pblock_set( pb, SLAPI_EXT_OP_REQ_OID,
|
rs->sr_err = slapi_pblock_set( pb, SLAPI_EXT_OP_REQ_OID,
|
||||||
(void *)op->ore_reqoid.bv_val);
|
(void *)op->ore_reqoid.bv_val);
|
||||||
if ( rs->sr_err != LDAP_SUCCESS ) {
|
if ( rs->sr_err != LDAP_SUCCESS ) {
|
||||||
@ -329,9 +301,32 @@ done2:;
|
|||||||
if ( rs->sr_rspdata != NULL ) {
|
if ( rs->sr_rspdata != NULL ) {
|
||||||
ber_bvfree( rs->sr_rspdata );
|
ber_bvfree( rs->sr_rspdata );
|
||||||
}
|
}
|
||||||
|
} else { /* start of OpenLDAP extended operation */
|
||||||
} /* end of Netscape extended operation */
|
|
||||||
#endif /* defined( LDAP_SLAPI ) */
|
#endif /* defined( LDAP_SLAPI ) */
|
||||||
|
if (reqdata.bv_val) op->ore_reqdata = &reqdata;
|
||||||
|
rs->sr_err = (ext->ext_main)( op, rs );
|
||||||
|
|
||||||
|
if( rs->sr_err != SLAPD_ABANDON ) {
|
||||||
|
if ( rs->sr_err == LDAP_REFERRAL && rs->sr_ref == NULL ) {
|
||||||
|
rs->sr_ref = referral_rewrite( default_referral,
|
||||||
|
NULL, NULL, LDAP_SCOPE_DEFAULT );
|
||||||
|
}
|
||||||
|
|
||||||
|
send_ldap_extended( op, rs );
|
||||||
|
|
||||||
|
ber_bvarray_free( rs->sr_ref );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( rs->sr_rspoid != NULL ) {
|
||||||
|
free( (char *)rs->sr_rspoid );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( rs->sr_rspdata != NULL ) {
|
||||||
|
ber_bvfree( rs->sr_rspdata );
|
||||||
|
}
|
||||||
|
#ifdef LDAP_SLAPI
|
||||||
|
} /* end of OpenLDAP extended operation */
|
||||||
|
#endif /* LDAP_SLAPI */
|
||||||
|
|
||||||
done:
|
done:
|
||||||
return rs->sr_err;
|
return rs->sr_err;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
* so it can be used in ACLs
|
* so it can be used in ACLs
|
||||||
*/
|
*/
|
||||||
static struct slap_listener slap_unknown_listener = {
|
static struct slap_listener slap_unknown_listener = {
|
||||||
BER_BVC("unknown"), /* FIXME: use a URI form? */
|
BER_BVC("unknown"), /* FIXME: use a URI form? (e.g. slapi://) */
|
||||||
BER_BVC("UNKNOWN")
|
BER_BVC("UNKNOWN")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user