]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backend.c
fix Release configuration
[openldap] / servers / slapd / backend.c
index 8001fc4b121b4e78d4765b83cfac7259fc11780b..cac82703390e3f06f4984a4f7fcc2fcc621e95ea 100644 (file)
@@ -11,6 +11,7 @@
 #include <sys/stat.h>
 
 #include "slap.h"
+#include "lutil.h"
 
 #ifdef SLAPD_LDBM
 #include "back-ldbm/external.h"
@@ -27,6 +28,9 @@
 #ifdef SLAPD_SHELL
 #include "back-shell/external.h"
 #endif
+#ifdef SLAPD_TCL
+#include "back-tcl/external.h"
+#endif
 
 static BackendInfo binfo[] = {
 #ifdef SLAPD_LDBM
@@ -43,6 +47,9 @@ static BackendInfo binfo[] = {
 #endif
 #ifdef SLAPD_SHELL
        {"shell",       shell_back_initialize},
+#endif
+#ifdef SLAPD_TCL
+       {"tcl",         tcl_back_initialize},
 #endif
        {NULL}
 };
@@ -179,20 +186,6 @@ int backend_startup(int n)
 
        /* open each backend database */
        for( i = 0; i < nBackendDB; i++ ) {
-               BackendInfo  *bi;
-
-               /* open the backend type, if not done already */
-               bi =  backendDB[i].bd_info;
-
-               if( bi->bi_nDB == 0) {
-                       /* no database of this type, don't open */
-                       Debug(LDAP_DEBUG_ANY, 
-                               "backend_startup: there should be no database (%d) of %s type.!\n",
-                               i, bi->bi_type, 0 );
-
-                       return -1;
-               }
-
                if ( backendDB[i].bd_info->bi_db_open ) {
                        rc = backendDB[i].bd_info->bi_db_open(
                                &backendDB[i] );
@@ -360,7 +353,7 @@ be_db_close( void )
        int     i;
 
        for ( i = 0; i < nbackends; i++ ) {
-               if ( backends[i].bd_info->bi_db_close != NULL ) {
+               if ( backends[i].bd_info->bi_db_close ) {
                        (*backends[i].bd_info->bi_db_close)( &backends[i] );
                }
        }
@@ -460,8 +453,6 @@ be_isroot( Backend *be, char *ndn )
 char *
 be_root_dn( Backend *be )
 {
-       int rc;
-
        if ( be->be_root_dn == NULL ) {
                return( "" );
        }
@@ -491,6 +482,19 @@ be_isroot_pw( Backend *be, char *ndn, struct berval *cred )
        return result == 0;
 }
 
+int
+be_entry_release_rw( Backend *be, Entry *e, int rw )
+{
+       if ( be->be_release ) {
+               /* free and release entry from backend */
+               return be->be_release( be, e, rw );
+       } else {
+               /* free entry */
+               entry_free( e );
+               return 0;
+       }
+}
+
 int
 backend_unbind(
        Connection   *conn,
@@ -500,7 +504,7 @@ backend_unbind(
        int     i;
 
        for ( i = 0; i < nbackends; i++ ) {
-               if ( backends[i].be_unbind != NULL ) {
+               if ( backends[i].be_unbind ) {
                        (*backends[i].be_unbind)( &backends[i], conn, op );
                }
        }