Commit 507781ee authored by Howard Chu's avatar Howard Chu
Browse files

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

parent 7735c441
......@@ -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,
......
......@@ -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
......
......@@ -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 */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment