From cfb3f815823d9a5903e71cf9162b25b152629740 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 13 May 2005 02:34:16 +0000 Subject: [PATCH] Control cleanup --- servers/slapd/backend.c | 8 ++++++-- servers/slapd/controls.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index f8dda1c50a..be7c78de35 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -821,8 +821,7 @@ backend_check_controls( break; case LDAP_COMPARE_FALSE: - if ( !op->o_bd->be_ctrls[ cid ] && (*ctrls)->ldctl_iscritical ) - { + if ( !op->o_bd->be_ctrls[cid] && (*ctrls)->ldctl_iscritical ) { /* Per RFC 2251 (and LDAPBIS discussions), if the control * is recognized and appropriate for the operation (which * we've already verified), then the server should make @@ -844,6 +843,11 @@ backend_check_controls( default: /* unreachable */ + Debug( LDAP_DEBUG_ANY, + "backend_check_controls: unable to check control: %s\n", + (*ctrls)->ldctl_oid, 0, 0 ); + assert( 0 ); + rs->sr_text = "unable to check control"; rs->sr_err = LDAP_OTHER; goto done; diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 26f88654f8..252912b22f 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -1236,7 +1236,7 @@ static int parseSubentries ( ? SLAP_CONTROL_CRITICAL : SLAP_CONTROL_NONCRITICAL; - if ( (void *)(ctrl->ldctl_value.bv_val[2] != 0x00)) { + if (ctrl->ldctl_value.bv_val[2]) { set_subentries_visibility( op ); }