]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backover.c
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / servers / slapd / backover.c
index 320b3385c01ef5402a63e90b6486c27dba8021cb..02dc5125cbba412a0a532b6bbd6138b30a392d75 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003-2012 The OpenLDAP Foundation.
+ * Copyright 2003-2013 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -150,6 +150,8 @@ over_db_open(
        }
 
        for (; on && rc == 0; on=on->on_next) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                db.bd_info = &on->on_bi;
                if ( db.bd_info->bi_db_open ) {
                        rc = db.bd_info->bi_db_open( &db, cr );
@@ -171,6 +173,8 @@ over_db_close(
        int rc = 0;
 
        for (; on && rc == 0; on=on->on_next) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                be->bd_info = &on->on_bi;
                if ( be->bd_info->bi_db_close ) {
                        rc = be->bd_info->bi_db_close( be, cr );
@@ -203,6 +207,8 @@ over_db_destroy(
        }
 
        for (; on && rc == 0; on=on->on_next) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                be->bd_info = &on->on_bi;
                if ( be->bd_info->bi_db_destroy ) {
                        rc = be->bd_info->bi_db_destroy( be, cr );
@@ -232,6 +238,8 @@ over_back_response ( Operation *op, SlapReply *rs )
        db.be_flags |= SLAP_DBFLAG_OVERLAY;
        op->o_bd = &db;
        for (; on; on=on->on_next ) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                if ( on->on_response ) {
                        db.bd_info = (BackendInfo *)on;
                        rc = on->on_response( op, rs );
@@ -277,6 +285,8 @@ over_access_allowed(
        on = oi->oi_list;
 
        for ( ; on; on = on->on_next ) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                if ( on->on_bi.bi_access_allowed ) {
                        /* NOTE: do not copy the structure until required */
                        if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
@@ -338,6 +348,8 @@ overlay_entry_get_ov(
        int rc = SLAP_CB_CONTINUE;
 
        for ( ; on; on = on->on_next ) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                if ( on->on_bi.bi_entry_get_rw ) {
                        /* NOTE: do not copy the structure until required */
                        if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
@@ -409,6 +421,8 @@ overlay_entry_release_ov(
        int rc = SLAP_CB_CONTINUE;
 
        for ( ; on; on = on->on_next ) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                if ( on->on_bi.bi_entry_release_rw ) {
                        /* NOTE: do not copy the structure until required */
                        if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
@@ -487,6 +501,8 @@ over_acl_group(
        on = oi->oi_list;
 
        for ( ; on; on = on->on_next ) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                if ( on->on_bi.bi_acl_group ) {
                        /* NOTE: do not copy the structure until required */
                        if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
@@ -556,6 +572,8 @@ over_acl_attribute(
        on = oi->oi_list;
 
        for ( ; on; on = on->on_next ) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                if ( on->on_bi.bi_acl_attribute ) {
                        /* NOTE: do not copy the structure until required */
                        if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
@@ -655,6 +673,8 @@ int overlay_op_walk(
        int rc = SLAP_CB_CONTINUE;
 
        for (; on; on=on->on_next ) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                func = &on->on_bi.bi_op_bind;
                if ( func[which] ) {
                        op->o_bd->bd_info = (BackendInfo *)on;
@@ -849,6 +869,8 @@ over_connection_func(
        }
 
        for ( ; on; on = on->on_next ) {
+               if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+                       continue;
                func = &on->on_bi.bi_connection_init;
                if ( func[ which ] ) {
                        bd->bd_info = (BackendInfo *)on;
@@ -1214,8 +1236,12 @@ overlay_remove( BackendDB *be, slap_overinst *on, Operation *op )
        rm_cb->sc_private = (void*) rm_ctx;
 
        /* Append callback to the end of the list */
-       for ( cb = op->o_callback; cb->sc_next; cb = cb->sc_next );
-       cb->sc_next = rm_cb;
+       if ( !op->o_callback ) {
+               op->o_callback = rm_cb;
+       } else {
+               for ( cb = op->o_callback; cb->sc_next; cb = cb->sc_next );
+               cb->sc_next = rm_cb;
+       }
 }
 #endif /* SLAP_CONFIG_DELETE */