mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
Fix issues in bind response handling
This commit is contained in:
parent
545198c70d
commit
0ff462b619
@ -87,18 +87,23 @@ static int
|
|||||||
handle_bind_response( Operation *op, BerElement *ber )
|
handle_bind_response( Operation *op, BerElement *ber )
|
||||||
{
|
{
|
||||||
Connection *c = op->o_client;
|
Connection *c = op->o_client;
|
||||||
|
BerValue response;
|
||||||
BerElement *copy;
|
BerElement *copy;
|
||||||
ber_int_t msgid, result;
|
ber_int_t result;
|
||||||
ber_tag_t tag;
|
ber_tag_t tag;
|
||||||
int rc = 0;
|
int rc = LDAP_SUCCESS;
|
||||||
|
|
||||||
copy = ber_dup( ber );
|
if ( (copy = ber_alloc()) == NULL ) {
|
||||||
if ( !copy ) {
|
|
||||||
rc = -1;
|
rc = -1;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = ber_scanf( copy, "{i{e" /* "}}" */, &msgid, &result );
|
tag = ber_peek_element( ber, &response );
|
||||||
|
assert( tag == LDAP_RES_BIND );
|
||||||
|
|
||||||
|
ber_init2( copy, &response, 0 );
|
||||||
|
|
||||||
|
tag = ber_get_enum( copy, &result );
|
||||||
ber_free( copy, 0 );
|
ber_free( copy, 0 );
|
||||||
|
|
||||||
if ( tag == LBER_ERROR ) {
|
if ( tag == LBER_ERROR ) {
|
||||||
@ -132,16 +137,15 @@ handle_bind_response( Operation *op, BerElement *ber )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CONNECTION_UNLOCK(c);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if ( rc ) {
|
if ( rc ) {
|
||||||
operation_destroy_from_client( op );
|
operation_send_reject( op, LDAP_OTHER, "internal error", 0 );
|
||||||
CONNECTION_UNLOCK(c);
|
|
||||||
|
|
||||||
ber_free( ber, 1 );
|
ber_free( ber, 1 );
|
||||||
return rc;
|
return LDAP_SUCCESS;
|
||||||
}
|
}
|
||||||
CONNECTION_UNLOCK(c);
|
|
||||||
return forward_final_response( op, ber );
|
return forward_final_response( op, ber );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user