From 873be21a22ee220e096691f7593ba5bdd5d8ab8e Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 5 Apr 2004 17:28:13 +0000 Subject: [PATCH] add referral check to functions elaborated by overlays --- servers/slapd/backover.c | 33 ++++++++++++++++++++++++++++++--- servers/slapd/slap.h | 6 +++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index 060d7b0245..fabc7ae42f 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -146,9 +146,21 @@ over_back_response ( Operation *op, SlapReply *rs ) return rc; } -enum op_which { op_bind = 0, op_unbind, op_search, op_compare, - op_modify, op_modrdn, op_add, op_delete, op_abandon, - op_cancel, op_extended }; +enum op_which { + op_bind = 0, + op_unbind, + op_search, + op_compare, + op_modify, + op_modrdn, + op_add, + op_delete, + op_abandon, + op_cancel, + op_extended, + op_aux_chk_referrals, + op_last +}; static int over_op_func( @@ -257,6 +269,12 @@ over_op_extended( Operation *op, SlapReply *rs ) return over_op_func( op, rs, op_extended ); } +static int +over_chk_referrals( Operation *op, SlapReply *rs ) +{ + return over_op_func( op, rs, op_aux_chk_referrals ); +} + int overlay_register( slap_overinst *on @@ -325,8 +343,17 @@ overlay_config( BackendDB *be, const char *ov ) bi->bi_op_delete = over_op_delete; bi->bi_op_abandon = over_op_abandon; bi->bi_op_cancel = over_op_cancel; + bi->bi_extended = over_op_extended; + /* + * this is fine because it has the same + * args of the operations; we need to rework + * all the hooks to share the same args + * of the operations... + */ + bi->bi_chk_referrals = over_chk_referrals; + be->bd_info = bi; } else { diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index fe07730bee..b600750fe5 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -1412,9 +1412,9 @@ struct slap_backend_db { #define be_extended bd_info->bi_extended +#define be_chk_referrals bd_info->bi_chk_referrals #define be_fetch bd_info->bi_entry_get_rw #define be_release bd_info->bi_entry_release_rw -#define be_chk_referrals bd_info->bi_chk_referrals #define be_group bd_info->bi_acl_group #define be_attribute bd_info->bi_acl_attribute #define be_operational bd_info->bi_operational @@ -1689,10 +1689,10 @@ typedef int (BI_op_delete) LDAP_P(( struct slap_op *op, struct slap_rep *rs )); typedef int (BI_op_abandon) LDAP_P(( struct slap_op *op, struct slap_rep *rs )); typedef int (BI_op_cancel) LDAP_P(( struct slap_op *op, struct slap_rep *rs )); typedef int (BI_op_extended) LDAP_P(( struct slap_op *op, struct slap_rep *rs )); +typedef int (BI_chk_referrals) LDAP_P(( struct slap_op *op, struct slap_rep *rs )); typedef int (BI_entry_release_rw) LDAP_P(( struct slap_op *op, Entry *e, int rw )); typedef int (BI_entry_get_rw) LDAP_P(( struct slap_op *op, struct berval *ndn, ObjectClass *oc, AttributeDescription *at, int rw, Entry **e )); -typedef int (BI_chk_referrals) LDAP_P(( struct slap_op *op, struct slap_rep *rs )); typedef int (BI_operational) LDAP_P(( struct slap_op *op, struct slap_rep *rs, int opattrs, Attribute **ap )); typedef int (BI_has_subordinates) LDAP_P(( struct slap_op *op, Entry *e, int *hasSubs )); @@ -1787,9 +1787,9 @@ struct slap_backend_info { BI_op_extended *bi_extended; /* Auxilary Functions */ + BI_chk_referrals *bi_chk_referrals; BI_entry_get_rw *bi_entry_get_rw; BI_entry_release_rw *bi_entry_release_rw; - BI_chk_referrals *bi_chk_referrals; BI_operational *bi_operational; BI_has_subordinates *bi_has_subordinates; -- 2.39.5