From: Kurt Zeilenga Date: Tue, 19 Jan 1999 18:39:20 +0000 (+0000) Subject: Don't allow suffixAliases were alias and aliased dn our the same. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~740 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3efaabe56032bcf5f619bc4f07b06a6fd19e8d45;p=openldap Don't allow suffixAliases were alias and aliased dn our the same. --- diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 2b13bdca59..2b726078de 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -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 */