]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-relay/init.c
Cleanup db_lock/unlock parameters
[openldap] / servers / slapd / back-relay / init.c
index d5a3d9ac15a5d4abacad01c05896079954e688ba..4a83e2f63ecccbfeb79ce7a9e8e191a3b77f09a9 100644 (file)
@@ -1,7 +1,7 @@
 /* init.c - initialize relay backend */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2004-2005 The OpenLDAP Foundation.
+ * Copyright 2004-2006 The OpenLDAP Foundation.
  * Portions Copyright 2004 Pierangelo Masarati.
  * All rights reserved.
  *
@@ -21,6 +21,7 @@
 #include "portable.h"
 
 #include <stdio.h>
+#include <ac/string.h>
 
 #include "slap.h"
 #include "back-relay.h"
@@ -99,18 +100,14 @@ relay_back_db_open( Backend *be )
                ri->ri_bd = select_backend( &ri->ri_realsuffix, 0, 1 );
 
                /* must be there: it was during config! */
-               assert( ri->ri_bd );
+               assert( ri->ri_bd != NULL );
 
                /* inherit controls */
-               if ( ri->ri_bd->be_controls ) {
-                       be->be_controls = ldap_charray_dup( ri->ri_bd->be_controls );
-               }
+               AC_MEMCPY( be->be_ctrls, ri->ri_bd->be_ctrls, sizeof( be->be_ctrls ) );
 
        } else {
                /* inherit all? */
-               if ( frontendDB->be_controls ) {
-                       be->be_controls = ldap_charray_dup( frontendDB->be_controls );
-               }
+               AC_MEMCPY( be->be_ctrls, frontendDB->be_ctrls, sizeof( be->be_ctrls ) );
        }
 
        return 0;