From: Kurt Zeilenga Date: Wed, 26 Jan 2005 19:46:12 +0000 (+0000) Subject: Place control availability kludge behind X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~241 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ab455a5ec72545d8afeb2d9bf6e727d05e47291a;p=openldap Place control availability kludge behind #ifdef SLAP_CONTROL_AVAILABILITY_KLUDGE for now. Me think its still needed (at least for FRONTEND controls). --- diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 7fb2c42edd..b3377d179e 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -845,11 +845,15 @@ backend_check_controls( if( ctrls ) { for( ; *ctrls != NULL ; ctrls++ ) { - /* KLUDGE: ldctl_iscritical munged by controls.c:get_ctrls() - * to ensure this check is enabled/disabled appropriately. - */ - if( (*ctrls)->ldctl_iscritical && !ldap_charray_inlist( - op->o_bd->be_controls, (*ctrls)->ldctl_oid ) ) + if( +#ifdef SLAP_CONTROL_AVAILABILITY_KLUDGE + /* KLUDGE: ldctl_iscritical munged by controls.c:get_ctrls() + * to ensure this check is enabled/disabled appropriately. + */ + (*ctrls)->ldctl_iscritical && +#endif + !ldap_charray_inlist( op->o_bd->be_controls, + (*ctrls)->ldctl_oid ) ) { /* Per RFC 2251 (and LDAPBIS discussions), if the control * is recognized and appropriate for the operation (which diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 9524cbf2d3..88c968ce74 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -612,6 +612,7 @@ int get_ctrls( goto return_results; } +#ifdef SLAP_CONTROL_AVAILABILITY_KLUDGE if ( sc->sc_mask & SLAP_CTRL_FRONTEND ) { /* KLUDGE: disable backend_control() check */ c->ldctl_iscritical = 0; @@ -626,6 +627,7 @@ int get_ctrls( /* KLUDGE: enable backend_control() check */ c->ldctl_iscritical = 1; } +#endif } else if( c->ldctl_iscritical ) { /* unavailable CRITICAL control */ diff --git a/servers/slapd/mr.c b/servers/slapd/mr.c index 89381cc38b..976721669c 100644 --- a/servers/slapd/mr.c +++ b/servers/slapd/mr.c @@ -217,9 +217,7 @@ register_matching_rule( int code; const char *err; - if( def->mrd_usage == SLAP_MR_NONE && - def->mrd_compat_syntaxes == NULL ) - { + if( def->mrd_usage == SLAP_MR_NONE && def->mrd_compat_syntaxes == NULL ) { Debug( LDAP_DEBUG_ANY, "register_matching_rule: not usable %s\n", def->mrd_desc, 0, 0 ); @@ -228,10 +226,9 @@ register_matching_rule( if( def->mrd_associated != NULL ) { amr = mr_find( def->mrd_associated ); - if( amr == NULL ) { - Debug( LDAP_DEBUG_ANY, "register_matching_rule: could not locate " - "associated matching rule %s for %s\n", + Debug( LDAP_DEBUG_ANY, "register_matching_rule: " + "could not locate associated matching rule %s for %s\n", def->mrd_associated, def->mrd_desc, 0 ); return -1; @@ -243,17 +240,15 @@ register_matching_rule( if (( def->mrd_usage & SLAP_MR_EQUALITY ) && (( def->mrd_usage & SLAP_MR_SUBTYPE_MASK ) != SLAP_MR_NONE )) { - Debug( LDAP_DEBUG_ANY, - "register_matching_rule: inappropriate (approx) association " - "%s for %s\n", + Debug( LDAP_DEBUG_ANY, "register_matching_rule: " + "inappropriate (approx) association %s for %s\n", def->mrd_associated, def->mrd_desc, 0 ); return -1; } } else if (!( amr->smr_usage & SLAP_MR_EQUALITY )) { - Debug( LDAP_DEBUG_ANY, - "register_matching_rule: inappropriate (equalilty) association " - "%s for %s\n", + Debug( LDAP_DEBUG_ANY, "register_matching_rule: " + "inappropriate (equalilty) association %s for %s\n", def->mrd_associated, def->mrd_desc, 0 ); return -1; } diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 6ab8ad2075..eaf80b2885 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -58,6 +58,8 @@ LDAP_BEGIN_DECL +#define SLAP_CONTROL_AVAILABILITY_KLUDGE + #ifdef LDAP_DEVEL #define SLAP_ACL_HONOR_DISCLOSE /* partially implemented */ #define SLAP_DYNACL