Add some cheats to dnNormalize and dnMatch to workaround

ava normalization issues.
This commit is contained in:
Kurt Zeilenga 2001-12-24 20:07:19 +00:00
parent 3df5c17881
commit b735ca3237
3 changed files with 28 additions and 22 deletions

View file

@ -351,10 +351,12 @@ dnNormalize(
out = ber_bvdup( val );
}
/* FIXME: cheat! */
ldap_pvt_str2upper( out->bv_val );
Debug( LDAP_DEBUG_TRACE, "<<< dnNormalize: <%s>\n", out->bv_val, 0, 0 );
*normalized = out;
return LDAP_SUCCESS;
}
@ -423,8 +425,7 @@ dnPretty(
/*
* dnMatch routine
*
* note: uses exact string match (strcmp) because it is supposed to work
* on normalized DNs.
* FIXME: strcasecmp should be replaced with schema aware checks
*/
int
dnMatch(
@ -445,7 +446,7 @@ dnMatch(
match = value->bv_len - asserted->bv_len;
if ( match == 0 ) {
match = strcmp( value->bv_val, asserted->bv_val );
match = strcasecmp( value->bv_val, asserted->bv_val );
}
#ifdef NEW_LOGGING

View file

@ -65,7 +65,7 @@ str2entry( char *s )
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
"str2entry: \"%s\"\n", s ? s : "NULL" ));
"str2entry: \"%s\"\n", s ? s : "NULL" ));
#else
Debug( LDAP_DEBUG_TRACE, "=> str2entry\n",
s ? s : "NULL", 0, 0 );
@ -77,7 +77,7 @@ str2entry( char *s )
if( e == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"str2entry: entry allocation failed.\n" ));
"str2entry: entry allocation failed.\n" ));
#else
Debug( LDAP_DEBUG_ANY,
"<= str2entry NULL (entry allocation failed)\n",
@ -156,7 +156,7 @@ str2entry( char *s )
return NULL;
}
e->e_name.bv_val = pdn->bv_val != NULL
e->e_name.bv_val = ( pdn->bv_val != NULL )
? pdn->bv_val : ch_strdup( "" );
e->e_name.bv_len = pdn->bv_len;
free( pdn );
@ -169,7 +169,7 @@ str2entry( char *s )
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
"str2entry: str2ad(%s): %s\n", type, text ));
"str2entry: str2ad(%s): %s\n", type, text ));
#else
Debug( slapMode & SLAP_TOOL_MODE
? LDAP_DEBUG_ANY : LDAP_DEBUG_TRACE,
@ -186,7 +186,7 @@ str2entry( char *s )
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
"str2entry: str2undef_ad(%s): %s\n", type, text ));
"str2entry: str2undef_ad(%s): %s\n", type, text ));
#else
Debug( LDAP_DEBUG_ANY,
"<= str2entry: str2undef_ad(%s): %s\n",
@ -219,8 +219,8 @@ str2entry( char *s )
} else {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"str2entry: no validator for syntax %s\n",
ad->ad_type->sat_syntax->ssyn_oid ));
"str2entry: no validator for syntax %s\n",
ad->ad_type->sat_syntax->ssyn_oid ));
#else
Debug( LDAP_DEBUG_ANY,
"str2entry: no validator for syntax %s\n",
@ -235,8 +235,8 @@ str2entry( char *s )
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"str2entry: invalid value for syntax %s\n",
ad->ad_type->sat_syntax->ssyn_oid ));
"str2entry: invalid value for syntax %s\n",
ad->ad_type->sat_syntax->ssyn_oid ));
#else
Debug( LDAP_DEBUG_ANY,
"str2entry: invalid value for syntax %s\n",
@ -259,7 +259,7 @@ str2entry( char *s )
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
"str2entry: NULL (attr_merge)\n" ));
"str2entry: NULL (attr_merge)\n" ));
#else
Debug( LDAP_DEBUG_ANY,
"<= str2entry NULL (attr_merge)\n", 0, 0, 0 );
@ -278,8 +278,8 @@ str2entry( char *s )
if ( e->e_dn == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"str2entry: entry %ld has no dn.\n",
(long) e->e_id ));
"str2entry: entry %ld has no dn.\n",
(long) e->e_id ));
#else
Debug( LDAP_DEBUG_ANY, "str2entry: entry %ld has no dn\n",
(long) e->e_id, 0, 0 );
@ -296,8 +296,8 @@ str2entry( char *s )
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"str2entry: entry %ld has invalid dn: %s\n",
(long) e->e_id, e->e_dn ));
"str2entry: entry %ld has invalid dn: %s\n",
(long) e->e_id, e->e_dn ));
#else
Debug( LDAP_DEBUG_ANY,
"str2entry: entry %ld has invalid dn: %s\n",

View file

@ -76,11 +76,16 @@ main( int argc, char **argv )
/* check backend */
if( select_backend( e->e_ndn, is_entry_referral(e), nosubs ) != be ) {
fprintf( stderr, "%s: database (%s) not configured to "
"hold dn=\"%s\" (line=%d)\n",
progname,
fprintf( stderr, "%s: line %d: "
"database (%s) not configured to hold \"%s\"\n",
progname, lineno,
be ? be->be_suffix[0] : "<none>",
e->e_dn, lineno );
e->e_dn );
fprintf( stderr, "%s: line %d: "
"database (%s) not configured to hold \"%s\"\n",
progname, lineno,
be ? be->be_nsuffix[0]->bv_val : "<none>",
e->e_ndn );
rc = EXIT_FAILURE;
entry_free( e );
if( continuemode ) continue;