]> git.sur5r.net Git - openldap/commitdiff
Fix handling of non-critical controls for backends which
authorKurt Zeilenga <kurt@openldap.org>
Tue, 24 Sep 2002 18:20:59 +0000 (18:20 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 24 Sep 2002 18:20:59 +0000 (18:20 +0000)
support no controls.

libraries/libldap/charray.c
servers/slapd/backend.c

index b40e232f62c6afef4458d1777f4f706adbf83022..d29c5d58428f7ad3f5ff1423ac5a980c00e7e65b 100644 (file)
@@ -125,13 +125,15 @@ ldap_charray_inlist(
 {
        int     i;
 
-       for ( i = 0; a[i] != NULL; i++ ) {
+       if( a == NULL ) return 0;
+
+       for ( i=0; a[i] != NULL; i++ ) {
                if ( strcasecmp( s, a[i] ) == 0 ) {
-                       return( 1 );
+                       return 1;
                }
        }
 
-       return( 0 );
+       return 0;
 }
 
 char **
index 987eb8832c67d62f7126888403fc0df32a47f4b0..b5405dd3513fa8abc60b74372d3563ff58765a2b 100644 (file)
@@ -736,16 +736,9 @@ backend_check_controls(
        Operation *op,
        const char **text )
 {
-       LDAPControl **ctrls;
-       ctrls = op->o_ctrls;
-       if( ctrls == NULL ) {
-               return LDAP_SUCCESS;
-       }
+       LDAPControl **ctrls = op->o_ctrls;
 
-       if ( be->be_controls == NULL ) {
-               *text = "control unavailable in context";
-               return LDAP_UNAVAILABLE_CRITICAL_EXTENSION;
-       }
+       if( ctrls == NULL ) return LDAP_SUCCESS;
 
        for( ; *ctrls != NULL ; ctrls++ ) {
                if( (*ctrls)->ldctl_iscritical &&