From: Howard Chu Date: Mon, 7 Apr 2003 19:48:10 +0000 (+0000) Subject: Fix !ENABLE_REWRITE X-Git-Tag: AUTOCONF_2_57~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd76391078e0254a72345425b024f266f0e48061;p=openldap Fix !ENABLE_REWRITE --- diff --git a/servers/slapd/back-ldap/config.c b/servers/slapd/back-ldap/config.c index d03c1ea08f..7399a3cc02 100644 --- a/servers/slapd/back-ldap/config.c +++ b/servers/slapd/back-ldap/config.c @@ -221,11 +221,11 @@ ldap_back_db_config( return( rc ); #else /* !ENABLE_REWRITE */ - ber_bvarray_add( &li->suffix_massage, &pvnc ); - ber_bvarray_add( &li->suffix_massage, &nvnc ); + ber_bvarray_add( &li->rwmap.rwm_suffix_massage, &pvnc ); + ber_bvarray_add( &li->rwmap.rwm_suffix_massage, &nvnc ); - ber_bvarray_add( &li->suffix_massage, &prnc ); - ber_bvarray_add( &li->suffix_massage, &nrnc ); + ber_bvarray_add( &li->rwmap.rwm_suffix_massage, &prnc ); + ber_bvarray_add( &li->rwmap.rwm_suffix_massage, &nrnc ); #endif /* !ENABLE_REWRITE */ /* rewrite stuff ... */ diff --git a/servers/slapd/back-ldap/init.c b/servers/slapd/back-ldap/init.c index e2ccceebf8..efa8b88a4e 100644 --- a/servers/slapd/back-ldap/init.c +++ b/servers/slapd/back-ldap/init.c @@ -197,8 +197,8 @@ ldap_back_db_destroy( rewrite_info_delete( li->rwmap.rwm_rw ); } #else /* !ENABLE_REWRITE */ - if (li->suffix_massage) { - ber_bvarray_free( li->suffix_massage ); + if (li->rwmap.rwm_suffix_massage) { + ber_bvarray_free( li->rwmap.rwm_suffix_massage ); } #endif /* !ENABLE_REWRITE */ diff --git a/servers/slapd/back-ldap/suffixmassage.c b/servers/slapd/back-ldap/suffixmassage.c index 5e108b186c..bf3100e82c 100644 --- a/servers/slapd/back-ldap/suffixmassage.c +++ b/servers/slapd/back-ldap/suffixmassage.c @@ -107,7 +107,7 @@ ldap_back_dn_massage( res->bv_len = 0; return 0; } - if ( dc->li == NULL || dc->li->suffix_massage == NULL ) { + if ( dc->rwmap == NULL || dc->rwmap->rwm_suffix_massage == NULL ) { *res = *dn; return 0; } @@ -126,9 +126,9 @@ ldap_back_dn_massage( } for ( i = 0; - dc->li->suffix_massage[i].bv_val != NULL; + dc->rwmap->rwm_suffix_massage[i].bv_val != NULL; i += 4 ) { - int aliasLength = dc->li->suffix_massage[i+src].bv_len; + int aliasLength = dc->rwmap->rwm_suffix_massage[i+src].bv_len; int diff = dn->bv_len - aliasLength; if ( diff < 0 ) { @@ -140,11 +140,11 @@ ldap_back_dn_massage( /* At a DN Separator */ } - if ( !strcmp( dc->li->suffix_massage[i+src].bv_val, &dn->bv_val[diff] ) ) { - res->bv_len = diff + dc->li->suffix_massage[i+dst].bv_len; + if ( !strcmp( dc->rwmap->rwm_suffix_massage[i+src].bv_val, &dn->bv_val[diff] ) ) { + res->bv_len = diff + dc->rwmap->rwm_suffix_massage[i+dst].bv_len; res->bv_val = ch_malloc( res->bv_len + 1 ); strncpy( res->bv_val, dn->bv_val, diff ); - strcpy( &res->bv_val[diff], dc->li->suffix_massage[i+dst].bv_val ); + strcpy( &res->bv_val[diff], dc->rwmap->rwm_suffix_massage[i+dst].bv_val ); #ifdef NEW_LOGGING LDAP_LOG ( BACK_LDAP, ARGS, "ldap_back_dn_massage: converted \"%s\" to \"%s\"\n",