From: Howard Chu Date: Fri, 28 Feb 2003 08:34:31 +0000 (+0000) Subject: Partial fix of ITS#2335, restore proper CLDAP msg format for LDAPv2 X-Git-Tag: NO_SLAP_OP_BLOCKS~251 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=507781eeb36f8d1cc46a257185d8b62662d3bc92;p=openldap Partial fix of ITS#2335, restore proper CLDAP msg format for LDAPv2 --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 2e79468558..64ad6a846d 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -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, diff --git a/servers/slapd/result.c b/servers/slapd/result.c index bfda458460..4f43811454 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -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 diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 340e46538f..d9871e0ed1 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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 */