]> git.sur5r.net Git - openldap/commitdiff
ITS#6851 replace assert with error msg
authorHoward Chu <hyc@openldap.org>
Fri, 18 Nov 2011 01:31:50 +0000 (17:31 -0800)
committerHoward Chu <hyc@openldap.org>
Fri, 18 Nov 2011 01:35:10 +0000 (17:35 -0800)
servers/slapd/back-ldap/bind.c

index 9ef163c879d61cca0c537fed119f413947bfc518..a8c3ec24da73ccff4d4ab0d52bb00aa5f330ff99 100644 (file)
@@ -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;