do not use lutil_atoix() (ITS#6654)

This commit is contained in:
Pierangelo Masarati 2010-09-21 00:10:44 +00:00
parent 9d77d61314
commit 2b1b37cd4b

View file

@ -164,8 +164,16 @@ ldap_parse_ldif_record_x(
if ( dn == NULL ) { if ( dn == NULL ) {
if ( linenum+i == 1 && BV_CASEMATCH( lr->lr_btype+i, &BV_VERSION )) { if ( linenum+i == 1 && BV_CASEMATCH( lr->lr_btype+i, &BV_VERSION )) {
/* lutil_atoi() introduces a dependence of libldap
* on liblutil; we only allow version 1 by now (ITS#6654)
*/
#if 0
int v; int v;
if( lr->lr_vals[i].bv_len == 0 || lutil_atoi( &v, lr->lr_vals[i].bv_val) != 0 || v != 1 ) { if( lr->lr_vals[i].bv_len == 0 || lutil_atoi( &v, lr->lr_vals[i].bv_val) != 0 || v != 1 )
#endif
static const struct berval version1 = { 1, "1" };
if ( lr->lr_vals[i].bv_len != version1.bv_len || strncmp( lr->lr_vals[i].bv_val, version1.bv_val, version1.bv_len ) != 0 )
{
fprintf( stderr, fprintf( stderr,
_("%s: invalid version %s, line %d (ignored)\n"), _("%s: invalid version %s, line %d (ignored)\n"),
errstr, lr->lr_vals[i].bv_val, linenum ); errstr, lr->lr_vals[i].bv_val, linenum );