]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backend.c
Fallout from ITS#4986 - remove unused param of select_backend()
[openldap] / servers / slapd / backend.c
index 5ee85ecc4ac93dbf2f1dc4af25c2461ecd58072f..c18e7d3b6353d3d987407903abd96a92f21cdef0 100644 (file)
@@ -624,12 +624,11 @@ be_db_close( void )
 Backend *
 select_backend(
        struct berval * dn,
-       int manageDSAit,
        int noSubs )
 {
        int             j;
        ber_len_t       len, dnlen = dn->bv_len;
-       Backend         *be, *b2 = NULL;
+       Backend         *be;
 
        LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
                if ( be->be_nsuffix == NULL || SLAP_DBHIDDEN( be )) {
@@ -663,39 +662,12 @@ select_backend(
                        if ( strcmp( be->be_nsuffix[j].bv_val,
                                &dn->bv_val[dnlen-len] ) == 0 )
                        {
-                               if ( b2 == NULL ) {
-                                       b2 = be;
-
-#if 0
-                                       /* causes ITS#4986: a catchall relay
-                                        * database with empty suffix points
-                                        * to another database; operations
-                                        * directed to a specific database
-                                        * fail if manageDSAit is set.
-                                        * Not clear what's the purpose
-                                        * of this test */
-                                       if ( manageDSAit && len == dnlen &&
-                                               !SLAP_GLUE_SUBORDINATE( be ) )
-                                       {
-                                               continue;
-                                       }
-#endif
-
-                               } else {
-                                       /* If any parts of the tree are glued, use the first
-                                        * match regardless of manageDSAit. Otherwise use the
-                                        * last match.
-                                        */
-                                       if( !( SLAP_DBFLAGS( be ) & ( SLAP_DBFLAG_GLUE_INSTANCE |
-                                               SLAP_DBFLAG_GLUE_SUBORDINATE )))
-                                               b2 = be;
-                               }
-                               return b2;
+                               return be;
                        }
                }
        }
 
-       return b2;
+       return be;
 }
 
 int
@@ -1290,7 +1262,7 @@ fe_acl_group(
        GroupAssertion *g;
        Backend *be = op->o_bd;
 
-       op->o_bd = select_backend( gr_ndn, 0, 0 );
+       op->o_bd = select_backend( gr_ndn, 0 );
 
        for ( g = op->o_groups; g; g = g->ga_next ) {
                if ( g->ga_be != op->o_bd || g->ga_oc != group_oc ||
@@ -1408,7 +1380,7 @@ fe_acl_group(
                                                if ( user == NULL ) {   
                                                        int rc2;
 
-                                                       op->o_bd = select_backend( op_ndn, 0, 0 );
+                                                       op->o_bd = select_backend( op_ndn, 0 );
                                                        op->o_private = NULL;
                                                        rc2 = be_entry_get_rw( op, op_ndn, NULL, NULL, 0, &user );
                                                        user_priv = op->o_private;
@@ -1527,7 +1499,7 @@ fe_acl_attribute(
        AccessControlState      acl_state = ACL_STATE_INIT;
        Backend                 *be = op->o_bd;
 
-       op->o_bd = select_backend( edn, 0, 0 );
+       op->o_bd = select_backend( edn, 0 );
 
        if ( target && dn_match( &target->e_nname, edn ) ) {
                e = target;
@@ -1680,7 +1652,7 @@ backend_access(
        assert( edn != NULL );
        assert( access > ACL_NONE );
 
-       op->o_bd = select_backend( edn, 0, 0 );
+       op->o_bd = select_backend( edn, 0 );
 
        if ( target && dn_match( &target->e_nname, edn ) ) {
                e = target;
@@ -1802,7 +1774,7 @@ fe_aux_operational(
                BackendDB               *be_orig = op->o_bd;
 
                /* Let the overlays have a chance at this */
-               op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
+               op->o_bd = select_backend( &op->o_req_ndn, 0 );
                if ( op->o_bd != NULL && !be_match( op->o_bd, frontendDB ) &&
                        ( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
                        op->o_bd->be_operational != NULL )