Partial fix of ITS#2335, restore proper CLDAP msg format for LDAPv2

This commit is contained in:
Howard Chu 2003-02-28 08:34:31 +00:00
parent 7735c44167
commit 507781eeb3
3 changed files with 9 additions and 13 deletions

View File

@ -1439,19 +1439,18 @@ connection_input(
op->o_pagedresults_state = conn->c_pagedresults_state;
#endif
#ifdef LDAP_CONNECTIONLESS
op->o_peeraddr = peeraddr;
if (cdn ) {
ber_str2bv( cdn, 0, 1, &op->o_dn );
op->o_protocol = LDAP_VERSION2;
}
if (conn->c_is_udp) {
int rc;
if ( cdn ) {
ber_str2bv( cdn, 0, 1, &op->o_dn );
op->o_protocol = LDAP_VERSION2;
}
op->o_res_ber = ber_alloc_t( LBER_USE_DER );
if (op->o_res_ber == NULL)
return 1;
rc = ber_write(op->o_res_ber, (char *)&op->o_peeraddr, sizeof(struct sockaddr), 0);
rc = ber_write(op->o_res_ber, (char *)&peeraddr, sizeof(struct sockaddr), 0);
if (rc != sizeof(struct sockaddr)) {
#ifdef NEW_LOGGING
LDAP_LOG( CONNECTION, INFO,
@ -1464,7 +1463,7 @@ connection_input(
}
if (conn->c_protocol == LDAP_VERSION2) {
rc = ber_printf(op->o_res_ber, "{i{" /*}}*/, op->o_msgid);
rc = ber_printf(op->o_res_ber, "{is{" /*}}*/, op->o_msgid, "");
if (rc == -1) {
#ifdef NEW_LOGGING
LDAP_LOG( CONNECTION, INFO,

View File

@ -277,7 +277,7 @@ send_ldap_response(
}
#ifdef LDAP_CONNECTIONLESS
if (conn->c_is_udp && conn->c_protocol == LDAP_VERSION2) {
if (conn->c_is_udp && op->o_protocol == LDAP_VERSION2) {
rc = ber_printf( ber, "t{ess" /*"}}"*/,
tag, err,
matched == NULL ? "" : matched,
@ -774,8 +774,8 @@ slap_send_search_entry(
ber_init_w_nullc( ber, LBER_USE_DER );
#ifdef LDAP_CONNECTIONLESS
if (conn->c_is_udp && conn->c_protocol == LDAP_VERSION2) {
rc = ber_printf(ber, "t{0{" /*}}*/,
if (conn->c_is_udp && op->o_protocol == LDAP_VERSION2) {
rc = ber_printf(ber, "t{O{" /*}}*/,
LDAP_RES_SEARCH_ENTRY, &e->e_name);
} else
#endif

View File

@ -1807,9 +1807,6 @@ typedef struct slap_op {
LDAP_LIST_ENTRY(slap_op) link;
#endif
#ifdef LDAP_CONNECTIONLESS
Sockaddr o_peeraddr; /* UDP peer address */
#endif
AuthorizationInformation o_authz;
BerElement *o_ber; /* ber of the request */