From: Kurt Zeilenga Date: Tue, 24 Sep 2002 18:20:59 +0000 (+0000) Subject: Fix handling of non-critical controls for backends which X-Git-Tag: NO_SLAP_OP_BLOCKS~942 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bbbf2f4ca7aa50bea416340d00cb9d2dd695b94a;p=openldap Fix handling of non-critical controls for backends which support no controls. --- diff --git a/libraries/libldap/charray.c b/libraries/libldap/charray.c index b40e232f62..d29c5d5842 100644 --- a/libraries/libldap/charray.c +++ b/libraries/libldap/charray.c @@ -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 ** diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 987eb8832c..b5405dd351 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -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 &&