]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/translucent.c
Fix last commit: C90 rejects declaration after code
[openldap] / servers / slapd / overlays / translucent.c
index 66d090a26ef91bf2c2d23db90a3a3a1d7f156a7b..f5d3cf8e380962f1e06d9880c805fbc8e271291d 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2004-2008 The OpenLDAP Foundation.
+ * Copyright 2004-2009 The OpenLDAP Foundation.
  * Portions Copyright 2005 Symas Corporation.
  * All rights reserved.
  *
@@ -432,6 +432,7 @@ static int translucent_modify(Operation *op, SlapReply *rs) {
 
        db = op->o_bd;
        op->o_bd = &ov->db;
+       ov->db.be_acl = op->o_bd->be_acl;
        rc = ov->db.bd_info->bi_entry_get_rw(op, &op->o_req_ndn, NULL, NULL, 0, &re);
        if(rc != LDAP_SUCCESS || re == NULL ) {
                send_ldap_error((op), rs, LDAP_NO_SUCH_OBJECT,
@@ -629,6 +630,7 @@ static int translucent_compare(Operation *op, SlapReply *rs) {
 */
        db = op->o_bd;
        op->o_bd = &ov->db;
+       ov->db.be_acl = op->o_bd->be_acl;
        rc = ov->db.bd_info->bi_op_compare(op, rs);
        op->o_bd = db;
 
@@ -661,6 +663,7 @@ static int translucent_pwmod(Operation *op, SlapReply *rs) {
 */
        db = op->o_bd;
        op->o_bd = &ov->db;
+       ov->db.be_acl = op->o_bd->be_acl;
        rc = ov->db.bd_info->bi_entry_get_rw(op, &op->o_req_ndn, NULL, NULL, 0, &re);
        if(rc != LDAP_SUCCESS || re == NULL ) {
                send_ldap_error((op), rs, LDAP_NO_SUCH_OBJECT,
@@ -1096,6 +1099,7 @@ static int translucent_search(Operation *op, SlapReply *rs) {
        cb.sc_private = &tc;
        cb.sc_next = op->o_callback;
 
+       ov->db.be_acl = op->o_bd->be_acl;
        tc.db = op->o_bd;
        tc.on = on;
        tc.orig = op->ors_filter;
@@ -1106,6 +1110,8 @@ static int translucent_search(Operation *op, SlapReply *rs) {
        op->o_callback = &cb;
 
        if ( fr || !fl ) {
+               AttributeName *attrs = op->ors_attrs;
+               op->ors_attrs = NULL;
                op->o_bd = &ov->db;
                tc.step |= RMT_SIDE;
                if ( fl ) {
@@ -1114,6 +1120,7 @@ static int translucent_search(Operation *op, SlapReply *rs) {
                        filter2bv_x( op, fr, &op->ors_filterstr );
                }
                rc = ov->db.bd_info->bi_op_search(op, rs);
+               op->ors_attrs = attrs;
                op->o_bd = tc.db;
                if ( fl ) {
                        op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
@@ -1129,6 +1136,8 @@ static int translucent_search(Operation *op, SlapReply *rs) {
        op->ors_filterstr = fbv;
        op->ors_filter = tc.orig;
        op->o_callback = cb.sc_next;
+       rs->sr_attrs = op->ors_attrs;
+
        /* Send out anything remaining on the list and finish */
        if ( tc.step & USE_LIST ) {
                if ( tc.list ) {
@@ -1193,6 +1202,7 @@ static int translucent_bind(Operation *op, SlapReply *rs) {
 
        db = op->o_bd;
        op->o_bd = &ov->db;
+       ov->db.be_acl = op->o_bd->be_acl;
        rc = ov->db.bd_info->bi_op_bind(op, rs);
        op->o_bd = db;