mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-01 20:49:35 -05:00
Cleaner version of previous patch (keep operational attr code in backend.c)
This commit is contained in:
parent
27adb43cbf
commit
6ae5ce5b66
4 changed files with 51 additions and 50 deletions
|
|
@ -1558,6 +1558,55 @@ freeit: if ( e != target ) {
|
|||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
fe_aux_operational(
|
||||
Operation *op,
|
||||
SlapReply *rs )
|
||||
{
|
||||
Attribute **ap;
|
||||
int rc = 0;
|
||||
BackendDB *be_orig;
|
||||
|
||||
for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
|
||||
/* just count them */ ;
|
||||
|
||||
/*
|
||||
* If operational attributes (allegedly) are required,
|
||||
* and the backend supports specific operational attributes,
|
||||
* add them to the attribute list
|
||||
*/
|
||||
if ( SLAP_OPATTRS( rs->sr_attr_flags ) || ( rs->sr_attrs &&
|
||||
ad_inlist( slap_schema.si_ad_entryDN, rs->sr_attrs ) ) )
|
||||
{
|
||||
*ap = slap_operational_entryDN( rs->sr_entry );
|
||||
ap = &(*ap)->a_next;
|
||||
}
|
||||
|
||||
if ( SLAP_OPATTRS( rs->sr_attr_flags ) || ( rs->sr_attrs &&
|
||||
ad_inlist( slap_schema.si_ad_subschemaSubentry, rs->sr_attrs ) ) )
|
||||
{
|
||||
*ap = slap_operational_subschemaSubentry( op->o_bd );
|
||||
ap = &(*ap)->a_next;
|
||||
}
|
||||
|
||||
if ( op->o_bd != NULL )
|
||||
{
|
||||
/* Let the overlays have a chance at this */
|
||||
be_orig = op->o_bd;
|
||||
if ( SLAP_ISOVERLAY( be_orig ) )
|
||||
op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 );
|
||||
|
||||
if ( ( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
|
||||
op->o_bd && op->o_bd->be_operational != NULL )
|
||||
{
|
||||
rc = op->o_bd->be_operational( op, rs );
|
||||
}
|
||||
op->o_bd = be_orig;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int backend_operational( Operation *op, SlapReply *rs )
|
||||
{
|
||||
int rc;
|
||||
|
|
|
|||
|
|
@ -912,7 +912,7 @@ overlay_config( BackendDB *be, const char *ov )
|
|||
bi->bi_chk_controls = over_aux_chk_controls;
|
||||
|
||||
#ifdef SLAP_OVERLAY_ACCESS
|
||||
/* this has a specific arglist */
|
||||
/* these have specific arglists */
|
||||
bi->bi_access_allowed = over_access_allowed;
|
||||
bi->bi_acl_group = over_acl_group;
|
||||
bi->bi_acl_attribute = over_acl_attribute;
|
||||
|
|
|
|||
|
|
@ -42,55 +42,6 @@ static BackendInfo slap_frontendInfo;
|
|||
static BackendDB slap_frontendDB;
|
||||
BackendDB *frontendDB;
|
||||
|
||||
static int
|
||||
fe_aux_operational(
|
||||
Operation *op,
|
||||
SlapReply *rs )
|
||||
{
|
||||
Attribute **ap;
|
||||
int rc = 0;
|
||||
BackendDB *be_orig;
|
||||
|
||||
for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
|
||||
/* just count them */ ;
|
||||
|
||||
/*
|
||||
* If operational attributes (allegedly) are required,
|
||||
* and the backend supports specific operational attributes,
|
||||
* add them to the attribute list
|
||||
*/
|
||||
if ( SLAP_OPATTRS( rs->sr_attr_flags ) || ( rs->sr_attrs &&
|
||||
ad_inlist( slap_schema.si_ad_entryDN, rs->sr_attrs ) ) )
|
||||
{
|
||||
*ap = slap_operational_entryDN( rs->sr_entry );
|
||||
ap = &(*ap)->a_next;
|
||||
}
|
||||
|
||||
if ( SLAP_OPATTRS( rs->sr_attr_flags ) || ( rs->sr_attrs &&
|
||||
ad_inlist( slap_schema.si_ad_subschemaSubentry, rs->sr_attrs ) ) )
|
||||
{
|
||||
*ap = slap_operational_subschemaSubentry( op->o_bd );
|
||||
ap = &(*ap)->a_next;
|
||||
}
|
||||
|
||||
if ( op->o_bd != NULL )
|
||||
{
|
||||
/* Let the overlays have a chance at this */
|
||||
be_orig = op->o_bd;
|
||||
if ( SLAP_ISOVERLAY( be_orig ) )
|
||||
op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 );
|
||||
|
||||
if ( ( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
|
||||
op->o_bd && op->o_bd->be_operational != NULL )
|
||||
{
|
||||
rc = op->o_bd->be_operational( op, rs );
|
||||
}
|
||||
op->o_bd = be_orig;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
frontend_init( void )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1634,6 +1634,7 @@ LDAP_SLAPD_F (int) fe_op_delete LDAP_P((Operation *op, SlapReply *rs));
|
|||
LDAP_SLAPD_F (int) fe_op_modify LDAP_P((Operation *op, SlapReply *rs));
|
||||
LDAP_SLAPD_F (int) fe_op_modrdn LDAP_P((Operation *op, SlapReply *rs));
|
||||
LDAP_SLAPD_F (int) fe_op_search LDAP_P((Operation *op, SlapReply *rs));
|
||||
LDAP_SLAPD_F (int) fe_aux_operational LDAP_P((Operation *op, SlapReply *rs));
|
||||
#if 0
|
||||
LDAP_SLAPD_F (int) fe_op_unbind LDAP_P((Operation *op, SlapReply *rs));
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue