From: Hallvard Furuseth Date: Wed, 10 Aug 2005 00:54:38 +0000 (+0000) Subject: Read LDAPResult.resultCode & ModifyRequest.modification.operation X-Git-Tag: OPENLDAP_AC_BP~29 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d50820cdd6946243a1a813cc3abb2dc6d5a4fc40;p=openldap Read LDAPResult.resultCode & ModifyRequest.modification.operation and send SortResult.sortResult as BER ENUMERATED, not BER INTEGER. libldap: ldap_parse_extended_result, try_read1msg, build_result_ber, ldap_parse_sasl_bind_result. slapd: do_modify, send_ldap_controls. --- diff --git a/libraries/libldap/extended.c b/libraries/libldap/extended.c index f311557c5a..99d29d8f62 100644 --- a/libraries/libldap/extended.c +++ b/libraries/libldap/extended.c @@ -210,7 +210,7 @@ ldap_parse_extended_result ( return ld->ld_errno; } - rc = ber_scanf( ber, "{iaa" /*}*/, &errcode, + rc = ber_scanf( ber, "{eaa" /*}*/, &errcode, &ld->ld_matched, &ld->ld_error ); if( rc == LBER_ERROR ) { diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 56eb3291c3..2652c81f29 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -555,7 +555,7 @@ nextresp2: ber_len_t len; char *lr_res_error = NULL; - if ( ber_scanf( &tmpber, "{iaa",/*}*/ &lderr, + if ( ber_scanf( &tmpber, "{eaa",/*}*/ &lderr, &lr->lr_res_matched, &lr_res_error ) != LBER_ERROR ) { @@ -636,7 +636,7 @@ nextresp2: */ if ( tag == LDAP_RES_SEARCH_RESULT ) refer_cnt = 0; - } else if ( ber_scanf( &tmpber, "{iaa}", &lderr, + } else if ( ber_scanf( &tmpber, "{eaa}", &lderr, &lr->lr_res_matched, &lr_res_error ) != LBER_ERROR ) { @@ -978,7 +978,7 @@ build_result_ber( LDAP *ld, BerElement **bp, LDAPRequest *lr ) return( LBER_ERROR ); } - if ( ber_get_int( ber, &along ) == LBER_ERROR ) { + if ( ber_get_enum( ber, &along ) == LBER_ERROR ) { ld->ld_errno = LDAP_DECODING_ERROR; ber_free(ber, 1); return( LBER_ERROR ); diff --git a/libraries/libldap/sasl.c b/libraries/libldap/sasl.c index 91f30e6f67..849a9fa380 100644 --- a/libraries/libldap/sasl.c +++ b/libraries/libldap/sasl.c @@ -306,7 +306,7 @@ ldap_parse_sasl_bind_result( } else { ber_len_t len; - tag = ber_scanf( ber, "{iaa" /*}*/, + tag = ber_scanf( ber, "{eaa" /*}*/, &errcode, &ld->ld_matched, &ld->ld_error ); if( tag == LBER_ERROR ) { diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index becbd71310..7620c284a4 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -90,7 +90,7 @@ do_modify( tmp.sml_nvalues = NULL; - if ( ber_scanf( op->o_ber, "{i{m[W]}}", &mop, + if ( ber_scanf( op->o_ber, "{e{m[W]}}", &mop, &tmp.sml_type, &tmp.sml_values ) == LBER_ERROR ) { send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 081eae7b0e..d1e79bf339 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -266,7 +266,7 @@ send_ldap_controls( Operation *o, BerElement *ber, LDAPControl **c ) ber_init2( sber, NULL, LBER_USE_DER ); - ber_printf( sber, "{i}", LDAP_UNWILLING_TO_PERFORM ); + ber_printf( sber, "{e}", LDAP_UNWILLING_TO_PERFORM ); if( ber_flatten2( ber, &sorted.ldctl_value, 0 ) == -1 ) { return -1;