From 2b1b37cd4b4597fe0e92f34caf73b41d03c6761c Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 21 Sep 2010 00:10:44 +0000 Subject: [PATCH] do not use lutil_atoix() (ITS#6654) --- libraries/libldap/ldifutil.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/libldap/ldifutil.c b/libraries/libldap/ldifutil.c index 407c276d4e..ea78a0c78e 100644 --- a/libraries/libldap/ldifutil.c +++ b/libraries/libldap/ldifutil.c @@ -164,8 +164,16 @@ ldap_parse_ldif_record_x( if ( dn == NULL ) { 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; - 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, _("%s: invalid version %s, line %d (ignored)\n"), errstr, lr->lr_vals[i].bv_val, linenum ); -- 2.39.5