]> git.sur5r.net Git - openldap/commitdiff
For ITS#158: keep mixed-case backend suffix in addition to upcased suffix.
authorHoward Chu <hyc@openldap.org>
Tue, 25 May 1999 21:40:40 +0000 (21:40 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 25 May 1999 21:40:40 +0000 (21:40 +0000)
servers/slapd/backend.c
servers/slapd/config.c
servers/slapd/slap.h

index cac82703390e3f06f4984a4f7fcc2fcc621e95ea..2707e2633d8798861efe5f69e5b6cc7653a46cd2 100644 (file)
@@ -366,16 +366,16 @@ select_backend( char * dn )
 
        dnlen = strlen( dn );
        for ( i = 0; i < nbackends; i++ ) {
-               for ( j = 0; backends[i].be_suffix != NULL &&
-                   backends[i].be_suffix[j] != NULL; j++ )
+               for ( j = 0; backends[i].be_nsuffix != NULL &&
+                   backends[i].be_nsuffix[j] != NULL; j++ )
                {
-                       len = strlen( backends[i].be_suffix[j] );
+                       len = strlen( backends[i].be_nsuffix[j] );
 
                        if ( len > dnlen ) {
                                continue;
                        }
 
-                       if ( strcmp( backends[i].be_suffix[j],
+                       if ( strcmp( backends[i].be_nsuffix[j],
                            dn + (dnlen - len) ) == 0 ) {
                                return( &backends[i] );
                        }
@@ -427,8 +427,8 @@ be_issuffix(
 {
        int     i;
 
-       for ( i = 0; be->be_suffix != NULL && be->be_suffix[i] != NULL; i++ ) {
-               if ( strcmp( be->be_suffix[i], suffix ) == 0 ) {
+       for ( i = 0; be->be_nsuffix != NULL && be->be_nsuffix[i] != NULL; i++ ) {
+               if ( strcmp( be->be_nsuffix[i], suffix ) == 0 ) {
                        return( 1 );
                }
        }
index 100400e9f3ae88030a917c35fc85762412fc3c32..af5f0ee5a5fbb3e22e2cbaa4b18e9c3e738fab66 100644 (file)
@@ -179,8 +179,10 @@ read_config( char *fname )
                                    fname, lineno, 0 );
                        } else {
                                char *dn = ch_strdup( cargv[1] );
-                               (void) dn_normalize_case( dn );
+                               (void) dn_normalize( dn );
                                charray_add( &be->be_suffix, dn );
+                               (void) dn_upcase( dn );
+                               charray_add( &be->be_nsuffix, dn );
                                free( dn );
                        }
 
index 10cd62fabcd70177c38577e1ea532ad9a8e2c15a..7ce8353259c9159d979ecfb4afc71e8e7d507fac 100644 (file)
@@ -255,6 +255,7 @@ struct backend_db {
 
        /* these should be renamed from be_ to bd_ */
        char    **be_suffix;    /* the DN suffixes of data in this backend */
+       char    **be_nsuffix;   /* the normalized DN suffixes in this backend */
        char    **be_suffixAlias;       /* the DN suffix aliases of data in this backend */
        char    *be_root_dn;    /* the magic "root" dn for this db      */
        char    *be_root_ndn;   /* the magic "root" normalized dn for this db   */