From: Pierangelo Masarati Date: Wed, 13 Apr 2005 01:03:46 +0000 (+0000) Subject: partially revert previous commit (ITS#3652) X-Git-Tag: OPENLDAP_AC_BP~905 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a6f8cd07f616f192284172ee372d6d14fac78d8b;p=openldap partially revert previous commit (ITS#3652) --- diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index c4ac1d9acf..d51ffa37d2 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -303,13 +303,13 @@ slap_access_allowed( ( state->as_recorded & ACL_STATE_RECORDED_NV ) ) { Debug( LDAP_DEBUG_ACL, - "slap_access_allowed: result from state (%s)\n", + "=> slap_access_allowed: result from state (%s)\n", attr, 0, 0 ); ret = state->as_result; goto done; } else { Debug( LDAP_DEBUG_ACL, - "slap_access_allowed: no res from state (%s)\n", + "=> slap_access_allowed: no res from state (%s)\n", attr, 0, 0 ); } } @@ -442,10 +442,15 @@ access_allowed_mask( assert( op->o_bd != NULL ); /* this is enforced in backend_add() */ - assert( op->o_bd->bd_info->bi_access_allowed ); + if ( op->o_bd->bd_info->bi_access_allowed ) { + /* delegate to backend */ + ret = op->o_bd->bd_info->bi_access_allowed( op, e, desc, val, access, state, &mask ); + + } else { + /* use default */ + ret = slap_access_allowed( op, e, desc, val, access, state, &mask ); + } - /* delegate to backend */ - ret = op->o_bd->bd_info->bi_access_allowed( op, e, desc, val, access, state, &mask ); if ( !ret ) { if ( ACL_IS_INVALID( mask ) ) { Debug( LDAP_DEBUG_ACL, diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 26c9d452fa..e7009867f1 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -123,12 +123,6 @@ int backend_init(void) return rc; } -#ifdef SLAP_OVERLAY_ACCESS - if ( bi->bi_access_allowed == NULL ) { - bi->bi_access_allowed = slap_access_allowed; - } -#endif /* SLAP_OVERLAY_ACCESS */ - LDAP_STAILQ_INSERT_TAIL(&backendInfo, bi, bi_next); } @@ -167,12 +161,6 @@ int backend_add(BackendInfo *aBackendInfo) return rc; } -#ifdef SLAP_OVERLAY_ACCESS - if ( aBackendInfo->bi_access_allowed == NULL ) { - aBackendInfo->bi_access_allowed = slap_access_allowed; - } -#endif /* SLAP_OVERLAY_ACCESS */ - (void)backend_init_controls( aBackendInfo ); /* now add the backend type to the Backend Info List */ diff --git a/servers/slapd/frontend.c b/servers/slapd/frontend.c index 1d20ed7cc0..f9cfe6f466 100644 --- a/servers/slapd/frontend.c +++ b/servers/slapd/frontend.c @@ -117,10 +117,6 @@ frontend_init( void ) frontendDB->bd_info->bi_op_search = fe_op_search; frontendDB->bd_info->bi_extended = fe_extended; -#ifdef SLAP_OVERLAY_ACCESS - frontendDB->bd_info->bi_access_allowed = slap_access_allowed; -#endif /* SLAP_OVERLAY_ACCESS */ - #if 0 /* FIXME: is this too early? */ return backend_startup_one( frontendDB );