]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backend.c
Fix previous commit
[openldap] / servers / slapd / backend.c
index 3c5d842059471af4b69bcc38f9ae256e25324d86..d2d3f5976c4c50ca73b0cf411ca9ca9844c3a562 100644 (file)
@@ -272,11 +272,11 @@ int backend_startup(Backend *be)
                if(rc != 0) {
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                                  "backend_startup: bi_db_open failed!\n" ));
+                               "backend_startup: bi_db_open failed! (%d)\n", rc ));
 #else
                        Debug( LDAP_DEBUG_ANY,
-                               "backend_startup: bi_db_open failed!\n",
-                               0, 0, 0 );
+                               "backend_startup: bi_db_open failed! (%d)\n",
+                               rc, 0, 0 );
 #endif
                        return rc;
                }
@@ -322,11 +322,12 @@ int backend_startup(Backend *be)
                if(rc != 0) {
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_CRIT,
-                                  "backend_startup: bi_db_open %d failed!\n", i ));
+                               "backend_startup: bi_db_open(%d) failed! (%d)\n",
+                               i, rc ));
 #else
                        Debug( LDAP_DEBUG_ANY,
-                               "backend_startup: bi_db_open %d failed!\n",
-                               i, 0, 0 );
+                               "backend_startup: bi_db_open(%d) failed! (%d)\n",
+                               i, rc, 0 );
 #endif
                        return rc;
                }
@@ -489,6 +490,7 @@ backend_db_init(
 
        be->be_restrictops = global_restrictops;
        be->be_requires = global_requires;
+       be->be_ssf_set = global_ssf_set;
 
        /* assign a default depth limit for alias deref */
        be->be_max_deref_depth = SLAPD_DEFAULT_MAXDEREFDEPTH; 
@@ -577,17 +579,13 @@ select_backend(
 int
 be_issuffix(
     Backend    *be,
-    const char *suffix
+    struct berval      *bvsuffix
 )
 {
        int     i;
-       size_t len = strlen(suffix);
 
        for ( i = 0; be->be_nsuffix != NULL && be->be_nsuffix[i] != NULL; i++ ) {
-               if ( len != be->be_nsuffix[i]->bv_len ) {
-                       continue;
-               }
-               if ( strcmp( be->be_nsuffix[i]->bv_val, suffix ) == 0 ) {
+               if ( ber_bvcmp( be->be_nsuffix[i], bvsuffix ) == 0 ) {
                        return( 1 );
                }
        }
@@ -606,7 +604,7 @@ be_isroot( Backend *be, struct berval *ndn )
                return( 0 );
        }
 
-       return strcmp( be->be_rootndn.bv_val, ndn->bv_val ) ? 0 : 1;
+       return dn_match( &be->be_rootndn, ndn );
 }
 
 int
@@ -620,7 +618,7 @@ be_isupdate( Backend *be, struct berval *ndn )
                return( 0 );
        }
 
-       return strcmp( be->be_update_ndn.bv_val, ndn->bv_val ) ? 0 : 1;
+       return dn_match( &be->be_update_ndn, ndn );
 }
 
 struct berval *
@@ -748,7 +746,7 @@ backend_check_controls(
                if( (*ctrls)->ldctl_iscritical &&
                        !charray_inlist( be->be_controls, (*ctrls)->ldctl_oid ) )
                {
-                       *text = "control unavailable in NamingContext";
+                       *text = "control unavailable in context";
                        return LDAP_UNAVAILABLE_CRITICAL_EXTENSION;
                }
        }
@@ -994,8 +992,7 @@ backend_group(
        ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
        if (i) return SLAPD_ABANDON;
 
-       if( target->e_nname.bv_len != gr_ndn->bv_len ||
-               strcmp( target->e_nname.bv_val, gr_ndn->bv_val ) != 0 ) {
+       if ( !dn_match( &target->e_nname, gr_ndn ) ) {
                /* we won't attempt to send it to a different backend */
                
                be = select_backend( gr_ndn, 0,
@@ -1051,12 +1048,10 @@ backend_attribute(
        Entry   *target,
        struct berval   *edn,
        AttributeDescription *entry_at,
-       BVarray *vals
+       BerVarray *vals
 )
 {
-       if( target == NULL || target->e_nname.bv_len != edn->bv_len ||
-               strcmp( target->e_ndn, edn->bv_val ) != 0 )
-       {
+       if ( target == NULL || !dn_match( &target->e_nname, edn ) ) {
                /* we won't attempt to send it to a different backend */
                
                be = select_backend( edn, 0,