From: Howard Chu Date: Fri, 18 Nov 2011 01:31:50 +0000 (-0800) Subject: ITS#6851 replace assert with error msg X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=111ecbdbedb0d7eb811d7bb73ebfa283afbd5a35;p=openldap ITS#6851 replace assert with error msg --- diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 9ef163c879..a8c3ec24da 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -1401,7 +1401,17 @@ retry_lock:; /* if we got here, it shouldn't return result */ rc = ldap_back_is_proxy_authz( op, rs, LDAP_BACK_DONTSEND, &binddn, &bindcred ); - assert( rc == 1 ); + if ( rc != 1 ) { + Debug( LDAP_DEBUG_ANY, "Error: ldap_back_is_proxy_authz " + "returned %d, misconfigured URI?\n", rc, 0, 0 ); + rs->sr_err = LDAP_OTHER; + rs->sr_text = "misconfigured URI?"; + LDAP_BACK_CONN_ISBOUND_CLEAR( lc ); + if ( sendok & LDAP_BACK_SENDERR ) { + send_ldap_result( op, rs ); + } + goto done; + } } rc = ldap_back_proxy_authz_bind( lc, op, rs, sendok, &binddn, &bindcred ); goto done;