X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fcompare.c;h=2b890b1fe9d7af4f47646f54b9bb5f93b162121c;hb=c1a257a83f3d8b9565238b5f9b8cad39a6194f63;hp=072def5471bed8245b17c072f6912dbc0d365fec;hpb=a53823a613a42bfa741385e862aca1bb3de0f628;p=openldap diff --git a/libraries/libldap/compare.c b/libraries/libldap/compare.c index 072def5471..2b890b1fe9 100644 --- a/libraries/libldap/compare.c +++ b/libraries/libldap/compare.c @@ -1,5 +1,6 @@ +/* $OpenLDAP$ */ /* - * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ /* Portions @@ -50,18 +51,29 @@ ldap_compare_ext( LDAPControl **cctrls, int *msgidp ) { + int rc; BerElement *ber; Debug( LDAP_DEBUG_TRACE, "ldap_compare\n", 0, 0, 0 ); + assert( ld != NULL ); + assert( LDAP_VALID( ld ) ); + assert( dn != NULL ); + assert( attr != NULL ); + assert( msgidp != NULL ); + + /* check client controls */ + rc = ldap_int_client_controls( ld, cctrls ); + if( rc != LDAP_SUCCESS ) return rc; + /* create a message to send */ - if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULL ) { return( LDAP_NO_MEMORY ); } - if ( ber_printf( ber, "{it{s{sO}}", /* leave open '}' */ + if ( ber_printf( ber, "{it{s{sON}N}", /* '}' */ ++ld->ld_msgid, - LDAP_REQ_COMPARE, dn, attr, &bvalue ) == -1 ) + LDAP_REQ_COMPARE, dn, attr, bvalue ) == -1 ) { ld->ld_errno = LDAP_ENCODING_ERROR; ber_free( ber, 1 ); @@ -74,7 +86,7 @@ ldap_compare_ext( return ld->ld_errno; } - if( ber_printf( ber, "}" ) == -1 ) { + if( ber_printf( ber, /*{*/ "N}" ) == -1 ) { ld->ld_errno = LDAP_ENCODING_ERROR; ber_free( ber, 1 ); return( ld->ld_errno );