]> git.sur5r.net Git - openldap/commitdiff
Place control availability kludge behind
authorKurt Zeilenga <kurt@openldap.org>
Wed, 26 Jan 2005 19:46:12 +0000 (19:46 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 26 Jan 2005 19:46:12 +0000 (19:46 +0000)
#ifdef SLAP_CONTROL_AVAILABILITY_KLUDGE
for now.  Me think its still needed (at least for FRONTEND controls).

servers/slapd/backend.c
servers/slapd/controls.c
servers/slapd/mr.c
servers/slapd/slap.h

index 7fb2c42eddb1f826c133b5a1f4db4b8eac2a9d7e..b3377d179e568b5129613a5cdd38fdd053e2d7b2 100644 (file)
@@ -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
index 9524cbf2d3487990efb72b0a9bd9f5bc6e303231..88c968ce749745d65b9c89b714985f8feae828fa 100644 (file)
@@ -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 */
index 89381cc38bb0114e6c37a39ed51fe2dc36747999..976721669cbbcc064f6d30200aba80afb3dfbc8f 100644 (file)
@@ -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;
                }
index 6ab8ad2075d3d24d27da8936c311c5f10031c374..eaf80b28857121a61dcfeaa9c90b3a830b95b2e5 100644 (file)
@@ -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