From bbbf2f4ca7aa50bea416340d00cb9d2dd695b94a Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 24 Sep 2002 18:20:59 +0000 Subject: [PATCH] Fix handling of non-critical controls for backends which support no controls. --- libraries/libldap/charray.c | 8 +++++--- servers/slapd/backend.c | 11 ++--------- 2 files changed, 7 insertions(+), 12 deletions(-) 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 && -- 2.39.5