Based upon patch submitted by Hallvard B. Furuseth <h.b.furuseth@usit.uio.no>.
main( int argc, char **argv )
{
char *s;
- int rc;
ber_tag_t tag;
ber_len_t len;
ber_sockbuf_add_io( sb, &ber_sockbuf_io_fd, LBER_SBIOD_LEVEL_PROVIDER,
(void *)&fd );
- if( (ber = ber_alloc_t(LBER_USE_DER)) == NULL ) {
+ ber = ber_alloc_t(LBER_USE_DER);
+ if( ber == NULL ) {
perror( "ber_alloc_t" );
return( EXIT_FAILURE );
}
- if(( tag = ber_get_next( sb, &len, ber) ) == LBER_ERROR ) {
+ tag = ber_get_next( sb, &len, ber);
+ if( tag == LBER_ERROR ) {
perror( "ber_get_next" );
return( EXIT_FAILURE );
}
printf("decode: format %s\n", fmt );
len = sizeof(buf);
- rc = ber_scanf( ber, fmt, &buf[0], &len );
+ tag = ber_scanf( ber, fmt, &buf[0], &len );
- if( rc == LBER_ERROR ) {
+ if( tag == LBER_ERROR ) {
perror( "ber_scanf" );
return( EXIT_FAILURE );
}
return LDAP_NO_MEMORY;
}
- if ( ber_flatten( ber, &bvalp ) == LBER_ERROR ) {
+ if ( ber_flatten( ber, &bvalp ) == -1 ) {
LDAP_FREE( ctrl );
return LDAP_NO_MEMORY;
}
*/
ber_int_t along;
ber_tag_t tag;
+ ber_tag_t rtag;
ber_int_t ver;
ber_int_t scope;
int rc;
* tagged with the operation code. For delete, the provided DN
* is not wrapped by a sequence.
*/
- rc = ber_scanf( &tmpber, "{it", /*}*/ &along, &tag );
+ rtag = ber_scanf( &tmpber, "{it", /*}*/ &along, &tag );
- if ( rc == LBER_ERROR ) {
+ if ( rtag == LBER_ERROR ) {
ld->ld_errno = LDAP_DECODING_ERROR;
return( NULL );
}
assert( tag != 0);
if ( tag == LDAP_REQ_BIND ) {
/* bind requests have a version number before the DN & other stuff */
- rc = ber_scanf( &tmpber, "{ia" /*}*/, &ver, &orig_dn );
+ rtag = ber_scanf( &tmpber, "{ia" /*}*/, &ver, &orig_dn );
} else if ( tag == LDAP_REQ_DELETE ) {
/* delete requests don't have a DN wrapping sequence */
- rc = ber_scanf( &tmpber, "a", &orig_dn );
+ rtag = ber_scanf( &tmpber, "a", &orig_dn );
} else if ( tag == LDAP_REQ_SEARCH ) {
/* search requests need to be re-scope-ed */
}
} else {
- rc = ber_scanf( &tmpber, "{a" /*}*/, &orig_dn );
+ rtag = ber_scanf( &tmpber, "{a" /*}*/, &orig_dn );
}
- if( rc == LBER_ERROR ) {
+ if( rtag == LBER_ERROR ) {
ld->ld_errno = LDAP_DECODING_ERROR;
return NULL;
}
tag = ber_next_element( ber, &len, last ) )
{
Modifications *mod;
+ ber_tag_t rtag;
- rc = ber_scanf( ber, "{m{W}}", &tmp.sml_type, &tmp.sml_bvalues );
+ rtag = ber_scanf( ber, "{m{W}}", &tmp.sml_type, &tmp.sml_bvalues );
- if ( rc == LBER_ERROR ) {
+ if ( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_add: conn %d decoding error \n", conn->c_connid ));
)
{
int rc;
+ ber_tag_t rtag;
struct berval type, value;
AttributeAssertion *aa;
- rc = ber_scanf( ber, "{mm}", &type, &value );
+ rtag = ber_scanf( ber, "{mm}", &type, &value );
- if( rc == LBER_ERROR ) {
+ if( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
"get_ava: ber_scanf failure\n" ));
const char **text
)
{
- int rc, tag;
+ int rc;
+ ber_tag_t tag, rtag;
ber_len_t length;
struct berval type = { 0, NULL }, value;
MatchingRuleAssertion *ma;
ma->ma_value.bv_len = 0;
ma->ma_value.bv_val = NULL;
- rc = ber_scanf( ber, "{t", &tag );
+ rtag = ber_scanf( ber, "{t", &tag );
- if( rc == LBER_ERROR ) {
+ if( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"get_mra: ber_scanf (\"{t\") failure\n" ));
}
if ( tag == LDAP_FILTER_EXT_OID ) {
- rc = ber_scanf( ber, "m", &ma->ma_rule_text );
- if ( rc == LBER_ERROR ) {
+ rtag = ber_scanf( ber, "m", &ma->ma_rule_text );
+ if ( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"get_mra: ber_scanf(\"o\") failure.\n" ));
return SLAPD_DISCONNECT;
}
- rc = ber_scanf( ber, "t", &tag );
- if( rc == LBER_ERROR ) {
+ rtag = ber_scanf( ber, "t", &tag );
+ if( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"get_mra: ber_scanf (\"t\") failure\n" ));
}
if ( tag == LDAP_FILTER_EXT_TYPE ) {
- rc = ber_scanf( ber, "m", &type );
- if ( rc == LBER_ERROR ) {
+ rtag = ber_scanf( ber, "m", &type );
+ if ( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"get_mra: ber_scanf (\"o\") failure.\n" ));
return SLAPD_DISCONNECT;
}
- rc = ber_scanf( ber, "t", &tag );
- if( rc == LBER_ERROR ) {
+ rtag = ber_scanf( ber, "t", &tag );
+ if( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"get_mra: ber_scanf (\"t\") failure.\n" ));
return SLAPD_DISCONNECT;
}
- rc = ber_scanf( ber, "m", &value );
+ rtag = ber_scanf( ber, "m", &value );
- if( rc == LBER_ERROR ) {
+ if( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"get_mra: ber_scanf (\"o\") failure.\n" ));
tag = ber_peek_tag( ber, &length );
if ( tag == LDAP_FILTER_EXT_DNATTRS ) {
- rc = ber_scanf( ber, "b}", &ma->ma_dnattrs );
+ rtag = ber_scanf( ber, "b}", &ma->ma_dnattrs );
} else {
- rc = ber_scanf( ber, "}" );
+ rtag = ber_scanf( ber, "}" );
}
- if( rc == LBER_ERROR ) {
+ if( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"get_mra: ber_scanf failure\n"));