From d64ec6ee0df9f8e2ec00ee945988a519ef5694f8 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 26 Dec 2001 17:40:34 +0000 Subject: [PATCH] modify be_referral to use struct berval DNs. --- servers/slapd/back-bdb/referral.c | 16 +++++------ servers/slapd/back-ldbm/referral.c | 22 +++++++-------- servers/slapd/back-monitor/init.c | 44 +++++++++++++++--------------- servers/slapd/backend.c | 2 +- servers/slapd/backglue.c | 6 ++-- servers/slapd/libslapd.dsp | 4 +++ servers/slapd/slap.h | 2 +- 7 files changed, 50 insertions(+), 46 deletions(-) diff --git a/servers/slapd/back-bdb/referral.c b/servers/slapd/back-bdb/referral.c index c32522d2dc..c02b78b1a7 100644 --- a/servers/slapd/back-bdb/referral.c +++ b/servers/slapd/back-bdb/referral.c @@ -17,8 +17,8 @@ bdb_referrals( BackendDB *be, Connection *conn, Operation *op, - const char *dn, - const char *ndn, + struct berval *dn, + struct berval *ndn, const char **text ) { struct bdb_info *bdb = (struct bdb_info *) be->be_private; @@ -36,7 +36,7 @@ bdb_referrals( } /* get entry */ - rc = bdb_dn2entry( be, NULL, ndn, &e, &matched, 0 ); + rc = bdb_dn2entry( be, NULL, ndn->bv_val, &e, &matched, 0 ); switch(rc) { case DB_NOTFOUND: @@ -66,7 +66,7 @@ bdb_referrals( if( is_entry_referral( matched ) ) { rc = LDAP_OTHER; refs = get_entry_referrals( be, conn, op, - matched, dn, LDAP_SCOPE_DEFAULT ); + matched, dn->bv_val, LDAP_SCOPE_DEFAULT ); } bdb_entry_return( be, matched ); @@ -74,7 +74,7 @@ bdb_referrals( } else if ( default_referral != NULL ) { rc = LDAP_OTHER; refs = referral_rewrite( default_referral, - NULL, dn, LDAP_SCOPE_DEFAULT ); + NULL, dn->bv_val, LDAP_SCOPE_DEFAULT ); } if( refs != NULL ) { @@ -95,13 +95,13 @@ bdb_referrals( if ( is_entry_referral( e ) ) { /* entry is a referral */ struct berval **refs = get_entry_referrals( be, - conn, op, e, dn, LDAP_SCOPE_DEFAULT ); + conn, op, e, dn->bv_val, LDAP_SCOPE_DEFAULT ); struct berval **rrefs = referral_rewrite( - refs, e->e_dn, dn, LDAP_SCOPE_DEFAULT ); + refs, e->e_dn, dn->bv_val, LDAP_SCOPE_DEFAULT ); Debug( LDAP_DEBUG_TRACE, "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - (long) op->o_tag, dn, e->e_dn ); + (long) op->o_tag, dn->bv_val, e->e_dn ); if( rrefs != NULL ) { send_ldap_result( conn, op, rc = LDAP_REFERRAL, diff --git a/servers/slapd/back-ldbm/referral.c b/servers/slapd/back-ldbm/referral.c index ae80f3617f..468d79b870 100644 --- a/servers/slapd/back-ldbm/referral.c +++ b/servers/slapd/back-ldbm/referral.c @@ -20,8 +20,8 @@ ldbm_back_referrals( Backend *be, Connection *conn, Operation *op, - const char *dn, - const char *ndn, + struct berval *dn, + struct berval *ndn, const char **text ) { struct ldbminfo *li = (struct ldbminfo *) be->be_private; @@ -39,7 +39,7 @@ ldbm_back_referrals( } /* get entry with reader lock */ - e = dn2entry_r( be, ndn, &matched ); + e = dn2entry_r( be, ndn->bv_val, &matched ); if ( e == NULL ) { char *matched_dn = NULL; struct berval **refs = NULL; @@ -50,17 +50,17 @@ ldbm_back_referrals( #ifdef NEW_LOGGING LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, "ldbm_back_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - op->o_tag, dn, matched_dn )); + op->o_tag, dn->bv_val, matched_dn )); #else Debug( LDAP_DEBUG_TRACE, "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - op->o_tag, dn, matched_dn ); + op->o_tag, dn->bv_val, matched_dn ); #endif if( is_entry_referral( matched ) ) { rc = LDAP_OTHER; refs = get_entry_referrals( be, conn, op, matched, - dn, LDAP_SCOPE_DEFAULT ); + dn->bv_val, LDAP_SCOPE_DEFAULT ); } cache_return_entry_r( &li->li_cache, matched ); @@ -68,7 +68,7 @@ ldbm_back_referrals( } else if ( default_referral != NULL ) { rc = LDAP_OTHER; refs = referral_rewrite( default_referral, - NULL, dn, LDAP_SCOPE_DEFAULT ); + NULL, dn->bv_val, LDAP_SCOPE_DEFAULT ); } if( refs != NULL ) { @@ -90,18 +90,18 @@ ldbm_back_referrals( if ( is_entry_referral( e ) ) { /* entry is a referral */ struct berval **refs = get_entry_referrals( be, - conn, op, e, dn, LDAP_SCOPE_DEFAULT ); + conn, op, e, dn->bv_val, LDAP_SCOPE_DEFAULT ); struct berval **rrefs = referral_rewrite( - refs, e->e_dn, dn, LDAP_SCOPE_DEFAULT ); + refs, e->e_dn, dn->bv_val, LDAP_SCOPE_DEFAULT ); #ifdef NEW_LOGGING LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - op->o_tag, dn, e->e_dn )); + op->o_tag, dn->bv_val, e->e_dn )); #else Debug( LDAP_DEBUG_TRACE, "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - op->o_tag, dn, e->e_dn ); + op->o_tag, dn->bv_val, e->e_dn ); #endif if( rrefs != NULL ) { diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index 6f214178ae..862683641f 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -162,47 +162,47 @@ monitor_back_initialize( bi->bi_controls = controls; - bi->bi_init = NULL; + bi->bi_init = 0; bi->bi_open = monitor_back_open; bi->bi_config = monitor_back_config; - bi->bi_close = NULL; - bi->bi_destroy = NULL; + bi->bi_close = 0; + bi->bi_destroy = 0; bi->bi_db_init = monitor_back_db_init; bi->bi_db_config = monitor_back_db_config; - bi->bi_db_open = NULL; - bi->bi_db_close = NULL; + bi->bi_db_open = 0; + bi->bi_db_close = 0; bi->bi_db_destroy = monitor_back_db_destroy; bi->bi_op_bind = monitor_back_bind; - bi->bi_op_unbind = NULL; + bi->bi_op_unbind = 0; bi->bi_op_search = monitor_back_search; bi->bi_op_compare = monitor_back_compare; bi->bi_op_modify = monitor_back_modify; - bi->bi_op_modrdn = NULL; - bi->bi_op_add = NULL; - bi->bi_op_delete = NULL; + bi->bi_op_modrdn = 0; + bi->bi_op_add = 0; + bi->bi_op_delete = 0; bi->bi_op_abandon = monitor_back_abandon; - bi->bi_extended = NULL; + bi->bi_extended = 0; - bi->bi_entry_release_rw = NULL; - bi->bi_acl_group = NULL; - bi->bi_acl_attribute = NULL; - bi->bi_chk_referrals = NULL; + bi->bi_entry_release_rw = 0; + bi->bi_acl_group = 0; + bi->bi_acl_attribute = 0; + bi->bi_chk_referrals = 0; bi->bi_operational = monitor_back_operational; /* * hooks for slap tools */ - bi->bi_tool_entry_open = NULL; - bi->bi_tool_entry_close = NULL; - bi->bi_tool_entry_first = NULL; - bi->bi_tool_entry_next = NULL; - bi->bi_tool_entry_get = NULL; - bi->bi_tool_entry_put = NULL; - bi->bi_tool_entry_reindex = NULL; - bi->bi_tool_sync = NULL; + bi->bi_tool_entry_open = 0; + bi->bi_tool_entry_close = 0; + bi->bi_tool_entry_first = 0; + bi->bi_tool_entry_next = 0; + bi->bi_tool_entry_get = 0; + bi->bi_tool_entry_put = 0; + bi->bi_tool_entry_reindex = 0; + bi->bi_tool_sync = 0; bi->bi_connection_init = 0; bi->bi_connection_destroy = 0; diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 39d528e776..92fdc25677 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -961,7 +961,7 @@ int backend_check_referrals( const char *text; rc = be->be_chk_referrals( be, - conn, op, dn->bv_val, ndn->bv_val, &text ); + conn, op, dn, ndn, &text ); if( rc != LDAP_SUCCESS && rc != LDAP_REFERRAL ) { send_ldap_result( conn, op, rc, diff --git a/servers/slapd/backglue.c b/servers/slapd/backglue.c index bbcd93ab66..e03fbfcee8 100644 --- a/servers/slapd/backglue.c +++ b/servers/slapd/backglue.c @@ -593,15 +593,15 @@ glue_back_referrals ( BackendDB *b0, Connection *conn, Operation *op, - const char *dn, - const char *ndn, + struct berval *dn, + struct berval *ndn, const char **text ) { BackendDB *be; int rc; - be = glue_back_select (b0, ndn); + be = glue_back_select (b0, ndn->bv_val); if (be && be->be_chk_referrals) { rc = be->be_chk_referrals (be, conn, op, dn, ndn, text); diff --git a/servers/slapd/libslapd.dsp b/servers/slapd/libslapd.dsp index d3c19992c6..7748aaaaee 100644 --- a/servers/slapd/libslapd.dsp +++ b/servers/slapd/libslapd.dsp @@ -188,6 +188,10 @@ SOURCE=.\config.c # End Source File # Begin Source File +SOURCE=.\configinfo.c +# End Source File +# Begin Source File + SOURCE=.\connection.c # End Source File # Begin Source File diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 5955aef7a0..51f5106bd1 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -1086,7 +1086,7 @@ typedef int (BI_entry_release_rw) LDAP_P((BackendDB *bd, typedef int (BI_chk_referrals) LDAP_P((BackendDB *bd, struct slap_conn *c, struct slap_op *o, - const char *dn, const char *ndn, + struct berval *dn, struct berval *ndn, const char **text )); typedef int (BI_acl_group) LDAP_P((Backend *bd, -- 2.39.5