]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/translucent.c
More schema tweaks
[openldap] / servers / slapd / overlays / translucent.c
index 38ff0039f66102fcf1bb5f19eb90dd2458bd2e25..85724d5f507f27f1c1b64a58da4ef55e2df0996a 100644 (file)
@@ -1,5 +1,22 @@
-/* Copyright 2004, Symas Corporation.
- * All Rights Reserved.
+/* translucent.c - translucent proxy module */
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2004-2005 The OpenLDAP Foundation.
+ * Portions Copyright 2005 Symas Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Symas Corp. for inclusion in
+ * OpenLDAP Software.  This work was sponsored by Hewlett-Packard.
  */
 
 #include "portable.h"
@@ -204,7 +221,6 @@ static int translucent_modify(Operation *op, SlapReply *rs) {
 
        slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
        overlay_stack *ov = on->on_bi.bi_private;
-       translucent_configuration *cf = ov->config;
        void *private = op->o_bd->be_private;
        Entry ne, *e, *re = NULL;
        Attribute *a, *ax;
@@ -274,7 +290,7 @@ static int translucent_modify(Operation *op, SlapReply *rs) {
                                mm = m;
                                m = m->sml_next;
                                mm->sml_next = NULL;            /* hack */
-                               slap_mods_free(mm);
+                               slap_mods_free(mm, 1);
                                if(m) continue;
                        }
                        m->sml_op = LDAP_MOD_ADD;
@@ -376,11 +392,9 @@ static int translucent_compare(Operation *op, SlapReply *rs) {
        slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
        overlay_stack *ov = on->on_bi.bi_private;
        void *private = op->o_bd->be_private;
-       translucent_configuration *cf = ov->config;
 
        AttributeAssertion *ava = op->orc_ava;
-       Attribute *a, *an, *ra, *as = NULL;
-       Entry *e, *ee, *re;
+       Entry *e;
        int rc;
 
        Debug(LDAP_DEBUG_TRACE, "==> translucent_compare: <%s> %s:%s\n",
@@ -423,9 +437,8 @@ static int translucent_search_cb(Operation *op, SlapReply *rs) {
        slap_overinst *on;
        Entry *e, *re = NULL;
        Attribute *a, *ax, *an, *as = NULL;
-       BerVarray b, bx;
        void *private;
-       int i, rc, size;
+       int rc;
 
        if(!op || !rs || rs->sr_type != REP_SEARCH || !rs->sr_entry)
                return(SLAP_CB_CONTINUE);
@@ -508,7 +521,6 @@ static int translucent_search(Operation *op, SlapReply *rs) {
        slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
        slap_callback cb = { NULL, NULL, NULL, NULL };
        overlay_stack *ov = on->on_bi.bi_private;
-       translucent_configuration *cf = ov->config;
        void *private = op->o_bd->be_private;
        int rc;
 
@@ -568,6 +580,7 @@ static int translucent_config(
        slap_overinst *on = (slap_overinst *) be->bd_info;
        overlay_stack *ov = on->on_bi.bi_private;
        void *private = be->be_private;
+       void *be_cf_ocs = be->be_cf_ocs;
        int rc;
 
        /* "this should never happen" */
@@ -577,8 +590,10 @@ static int translucent_config(
        }
 
        be->be_private = ov->private;
+       be->be_cf_ocs = ov->info->bi_cf_ocs;
        rc = ov->info->bi_db_config ? ov->info->bi_db_config(be, fname, lineno, argc, argv) : 0;
        be->be_private = private;
+       be->be_cf_ocs = be_cf_ocs;
 
        /* pass okay or error up, SLAP_CONF_UNKNOWN might be ours */
        if(rc == 0 || rc == 1) return(rc);
@@ -688,7 +703,6 @@ static int translucent_open(BackendDB *be) {
 static int translucent_close(BackendDB *be) {
        slap_overinst *on = (slap_overinst *) be->bd_info;
        overlay_stack *ov = on->on_bi.bi_private;
-       translucent_configuration *cf = ov->config;
        void *private = be->be_private;
        int rc;