From: Kurt Zeilenga Date: Mon, 18 Jan 1999 19:47:12 +0000 (+0000) Subject: Store rootdn in normalized uppercase format. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~752 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2805b256827af3f2999bc057d3b1d4baa9d46dc5;p=openldap Store rootdn in normalized uppercase format. --- diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index e88797c6d8..dc63e25231 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -225,13 +225,18 @@ be_issuffix( int be_isroot( Backend *be, char *dn ) { - if ( dn == NULL ) { + int rc; + char *ndn; + + if ( dn == NULL || be->be_rootdn == NULL ) { return( 0 ); } - return( be->be_rootdn != NULL - ? strcasecmp( be->be_rootdn, dn ) == 0 - : 0 ); + ndn = dn_normalize_case( ch_strdup( dn ) ); + rc = strcmp( be->be_rootdn, ndn ) ? 0 : 1; + + free(ndn); + return(rc); } int diff --git a/servers/slapd/config.c b/servers/slapd/config.c index d56881a836..5b4f409d9b 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -34,7 +34,7 @@ void read_config( char *fname, Backend **bep, FILE *pfp ) { FILE *fp; - char *line, *savefname, *dn; + char *line, *savefname; int cargc, savelineno; char *cargv[MAXARGS]; int lineno, i; @@ -128,7 +128,7 @@ read_config( char *fname, Backend **bep, FILE *pfp ) "%s: line %d: suffix line must appear inside a database definition (ignored)\n", fname, lineno, 0 ); } else { - dn = ch_strdup( cargv[1] ); + char *dn = ch_strdup( cargv[1] ); (void) dn_normalize( dn ); charray_add( &be->be_suffix, dn ); } @@ -155,7 +155,7 @@ 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 { - dn = ch_strdup( cargv[1] ); + char *dn = ch_strdup( cargv[1] ); (void) dn_normalize( dn ); charray_add( &be->be_suffixAlias, dn ); @@ -194,9 +194,7 @@ read_config( char *fname, Backend **bep, FILE *pfp ) "%s: line %d: rootdn line must appear inside a database definition (ignored)\n", fname, lineno, 0 ); } else { - dn = ch_strdup( cargv[1] ); - (void) dn_normalize( dn ); - be->be_rootdn = dn; + be->be_rootdn = dn_normalize_case( ch_strdup( cargv[1] ) ); } /* set super-secret magic database password */