From: Kurt Zeilenga Date: Wed, 20 Oct 2004 21:47:40 +0000 (+0000) Subject: Fix LDAP Intermediate Response tag values. X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~408 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=30fdb0e0cab3ae645ffc42375f19b0e4efb9a5c4;p=openldap Fix LDAP Intermediate Response tag values. with code to accept old values. --- diff --git a/include/ldap.h b/include/ldap.h index 99ed1fc011..b7cb33777d 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -356,6 +356,9 @@ typedef struct ldapcontrol { #define LDAP_TAG_EXOP_RES_OID ((ber_tag_t) 0x8aU) /* context specific + primitive */ #define LDAP_TAG_EXOP_RES_VALUE ((ber_tag_t) 0x8bU) /* context specific + primitive */ +#define LDAP_TAG_IM_RES_OID ((ber_tag_t) 0x80U) /* context specific + primitive */ +#define LDAP_TAG_IM_RES_VALUE ((ber_tag_t) 0x81U) /* context specific + primitive */ + #define LDAP_TAG_SASL_RES_CREDS ((ber_tag_t) 0x87U) /* context specific + primitive */ /* LDAP Request Messages */ diff --git a/libraries/libldap/extended.c b/libraries/libldap/extended.c index 10726c179a..c6a5b8753a 100644 --- a/libraries/libldap/extended.c +++ b/libraries/libldap/extended.c @@ -337,7 +337,7 @@ ldap_parse_intermediate ( tag = ber_peek_tag( ber, &len ); - if( tag == LDAP_TAG_EXOP_RES_OID ) { + if( tag == LDAP_TAG_IM_RES_OID || tag == LDAP_TAG_EXOP_RES_OID ) { /* we have a resoid */ if( ber_scanf( ber, "a", &resoid ) == LBER_ERROR ) { ld->ld_errno = LDAP_DECODING_ERROR; @@ -348,7 +348,7 @@ ldap_parse_intermediate ( tag = ber_peek_tag( ber, &len ); } - if( tag == LDAP_TAG_EXOP_RES_VALUE ) { + if( tag == LDAP_TAG_IM_RES_VALUE || tag == LDAP_TAG_EXOP_RES_VALUE ) { /* we have a resdata */ if( ber_scanf( ber, "O", &resdata ) == LBER_ERROR ) { ld->ld_errno = LDAP_DECODING_ERROR; diff --git a/servers/slapd/result.c b/servers/slapd/result.c index fe2f6e0c2f..f2ef04cb35 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -381,11 +381,15 @@ send_ldap_response( { if ( rs->sr_rspoid != NULL ) { rc = ber_printf( ber, "ts", - LDAP_TAG_EXOP_RES_OID, rs->sr_rspoid ); + rs->sr_type == REP_EXTENDED + ? LDAP_TAG_EXOP_RES_OID : LDAP_TAG_IM_RES_OID, + rs->sr_rspoid ); } if( rc != -1 && rs->sr_rspdata != NULL ) { rc = ber_printf( ber, "tO", - LDAP_TAG_EXOP_RES_VALUE, rs->sr_rspdata ); + rs->sr_type == REP_EXTENDED + ? LDAP_TAG_EXOP_RES_VALUE : LDAP_TAG_IM_RES_VALUE, + rs->sr_rspdata ); } }