]> git.sur5r.net Git - openldap/commitdiff
Don't allow suffixAliases were alias and aliased dn our the same.
authorKurt Zeilenga <kurt@openldap.org>
Tue, 19 Jan 1999 18:39:20 +0000 (18:39 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 19 Jan 1999 18:39:20 +0000 (18:39 +0000)
servers/slapd/config.c

index 2b13bdca59c4914270ffb119ea8489011b06a763..2b726078deaf1ed5b5123d7c3b09a652e9d7ae17 100644 (file)
@@ -155,13 +155,28 @@ read_config( char *fname, Backend **bep, FILE *pfp )
 "%s: line %d: suffixAlias line must appear inside a database definition (ignored)\n",
                                     fname, lineno, 0 );
                         } else {
-                                char *dn = ch_strdup( cargv[1] );
-                                (void) dn_normalize( dn );
-                                charray_add( &be->be_suffixAlias, dn );
+                                char *alias, *aliased_dn;
 
-                                dn = ch_strdup( cargv[2] );
-                                (void) dn_normalize( dn );
-                                charray_add( &be->be_suffixAlias, dn );
+                                                               alias = ch_strdup( cargv[1] );
+                                (void) dn_normalize( alias );
+
+                                aliased_dn = ch_strdup( cargv[2] );
+                                (void) dn_normalize( aliased_dn );
+
+
+                                                               if ( strcasecmp( alias, aliased_dn) ) {
+                                       Debug( LDAP_DEBUG_ANY,
+"%s: line %d: suffixAlias %s is not different from aliased dn (ignored)\n",
+                                    fname, lineno, alias );
+                                                               } else {
+                                       (void) dn_normalize_case( alias );
+                                       (void) dn_normalize_case( aliased_dn );
+                                       charray_add( &be->be_suffixAlias, alias );
+                                       charray_add( &be->be_suffixAlias, aliased_dn );
+                                                               }
+
+                                                               free(alias);
+                                                               free(aliased_dn);
                         }
 
                /* set max deref depth */