]> git.sur5r.net Git - openldap/commitdiff
ITS#7894 Let back-config use backend to release entries
authorOndřej Kuzník <ondra@mistotebe.net>
Tue, 22 Jul 2014 08:19:04 +0000 (10:19 +0200)
committerHoward Chu <hyc@openldap.org>
Tue, 22 Jul 2014 21:49:20 +0000 (14:49 -0700)
servers/slapd/bconfig.c

index ded66131b45b1d218114d15684c41e9da0495458..1275e1d5274132d3002215ac20ef17bf3fd9469b 100644 (file)
@@ -6581,10 +6581,22 @@ int config_entry_release(
        Entry *e,
        int rw )
 {
+       int rc = LDAP_SUCCESS;
+
        if ( !e->e_private ) {
-               entry_free( e );
+               BackendDB *be = op->o_bd;
+               CfBackInfo *cfb = be->be_private;
+               BackendInfo *bi = cfb->cb_db.bd_info;
+
+               if ( bi && bi->bi_entry_release_rw ) {
+                       op->o_bd = &cfb->cb_db;
+                       rc = bi->bi_entry_release_rw( op, e, rw );
+                       op->o_bd = be;
+               } else {
+                       entry_free( e );
+               }
        }
-       return LDAP_SUCCESS;
+       return rc;
 }
 
 /* return LDAP_SUCCESS IFF we can retrieve the specified entry.