]> git.sur5r.net Git - openldap/commitdiff
ITS#8150 let check_name_index handle frontend
authorRyan Tandy <ryan@nardis.ca>
Wed, 20 May 2015 21:39:08 +0000 (14:39 -0700)
committerHoward Chu <hyc@openldap.org>
Wed, 20 May 2015 22:36:42 +0000 (23:36 +0100)
The fix for ITS#7016 only adjusted the frontend entry's DN, but not the
naming attribute in the entry. check_name_index knows how to do both.

servers/slapd/bconfig.c

index 6268a99b303b3d052744aa7df0908522065fe456..495f6c1873b40a168db4263b25675ef2071e24a5 100644 (file)
@@ -4926,7 +4926,7 @@ check_name_index( CfEntryInfo *parent, ConfigType ce_type, Entry *e,
        if ( ce_type == Cft_Database )
                nsibs--;
 
-       if ( index != nsibs ) {
+       if ( index != nsibs || isfrontend ) {
                if ( gotindex ) {
                        if ( index < nsibs ) {
                                if ( tailindex ) return LDAP_NAMING_VIOLATION;
@@ -7491,22 +7491,6 @@ config_tool_entry_put( BackendDB *be, Entry *e, struct berval *text )
                                        return NOID;
                                }
                        } else {
-                               if ( !strncmp( e->e_nname.bv_val + 
-                                       STRLENOF( "olcDatabase" ), "=frontend",
-                                       STRLENOF( "=frontend" ) ) )
-                               {
-                                       struct berval rdn, pdn, ndn;
-                                       dnParent( &e->e_nname, &pdn );
-                                       rdn.bv_val = ca.log;
-                                       rdn.bv_len = snprintf(rdn.bv_val, sizeof( ca.log ),
-                                               "%s=" SLAP_X_ORDERED_FMT "%s",
-                                               cfAd_database->ad_cname.bv_val, -1,
-                                               frontendDB->bd_info->bi_type );
-                                       build_new_dn( &ndn, &pdn, &rdn, NULL );
-                                       ber_memfree( e->e_name.bv_val );
-                                       e->e_name = ndn;
-                                       ber_bvreplace( &e->e_nname, &e->e_name );
-                               }
                                entry_put_got_frontend++;
                                isFrontend = 1;
                        }