]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/translucent.c
check for ee == NULL
[openldap] / servers / slapd / overlays / translucent.c
index c8d3452e0574298a7382287023a78a61dd93fd51..db9079692f43fe09b21a1c796b98a66a0eb09c9f 100644 (file)
@@ -103,9 +103,9 @@ translucent_cfadd( Operation *op, SlapReply *rs, Entry *e, ConfigArgs *ca )
        Debug(LDAP_DEBUG_TRACE, "==> translucent_cfadd\n", 0, 0, 0);
 
        /* FIXME: should not hardcode "olcDatabase" here */
-       bv.bv_len = sprintf( ca->msg, "olcDatabase=%s",
+       bv.bv_len = sprintf( ca->cr_msg, "olcDatabase=%s",
                             ov->db.bd_info->bi_type );
-       bv.bv_val = ca->msg;
+       bv.bv_val = ca->cr_msg;
        ca->be = &ov->db;
 
        /* We can only create this entry if the database is table-driven
@@ -147,6 +147,7 @@ void glue_parent(Operation *op) {
        ber_dupbv(&e->e_nname, &ndn);
 
        a = attr_alloc( slap_schema.si_ad_objectClass );
+       a->a_numvals = 2;
        a->a_vals = ch_malloc(sizeof(struct berval) * 3);
        ber_dupbv(&a->a_vals[0], &glue[0]);
        ber_dupbv(&a->a_vals[1], &glue[1]);
@@ -156,6 +157,7 @@ void glue_parent(Operation *op) {
        e->e_attrs = a;
 
        a = attr_alloc( slap_schema.si_ad_structuralObjectClass );
+       a->a_numvals = 1;
        a->a_vals = ch_malloc(sizeof(struct berval) * 2);
        ber_dupbv(&a->a_vals[0], &glue[1]);
        ber_dupbv(&a->a_vals[1], &glue[2]);
@@ -428,6 +430,8 @@ release:
                atmp.a_desc = m->sml_desc;
                atmp.a_vals = m->sml_values;
                atmp.a_nvals = m->sml_nvalues ? m->sml_nvalues : atmp.a_vals;
+               atmp.a_numvals = m->sml_numvals;
+               atmp.a_flags = 0;
                a = attr_dup( &atmp );
                a->a_next  = ax;
                ax = a;
@@ -686,7 +690,7 @@ static int translucent_db_config(
 **
 */
 
-static int translucent_db_init(BackendDB *be, ConfigArgs *ca) {
+static int translucent_db_init(BackendDB *be, ConfigReply *cr) {
        slap_overinst *on = (slap_overinst *) be->bd_info;
        translucent_info *ov;
 
@@ -714,7 +718,7 @@ static int translucent_db_init(BackendDB *be, ConfigArgs *ca) {
 **
 */
 
-static int translucent_db_open(BackendDB *be, ConfigArgs *ca) {
+static int translucent_db_open(BackendDB *be, ConfigReply *cr) {
        slap_overinst *on = (slap_overinst *) be->bd_info;
        translucent_info *ov = on->on_bi.bi_private;
        int rc;
@@ -743,7 +747,7 @@ static int translucent_db_open(BackendDB *be, ConfigArgs *ca) {
 */
 
 static int
-translucent_db_close( BackendDB *be, ConfigArgs *ca )
+translucent_db_close( BackendDB *be, ConfigReply *cr )
 {
        slap_overinst *on = (slap_overinst *) be->bd_info;
        translucent_info *ov = on->on_bi.bi_private;
@@ -765,13 +769,13 @@ translucent_db_close( BackendDB *be, ConfigArgs *ca )
 */
 
 static int
-translucent_db_destroy( BackendDB *be, ConfigArgs *ca )
+translucent_db_destroy( BackendDB *be, ConfigReply *cr )
 {
        slap_overinst *on = (slap_overinst *) be->bd_info;
        translucent_info *ov = on->on_bi.bi_private;
        int rc = 0;
 
-       Debug(LDAP_DEBUG_TRACE, "==> translucent_db_close\n", 0, 0, 0);
+       Debug(LDAP_DEBUG_TRACE, "==> translucent_db_destroy\n", 0, 0, 0);
 
        if ( ov ) {
                if ( ov->db.be_private != NULL ) {