modify be_referral to use struct berval DNs.

This commit is contained in:
Kurt Zeilenga 2001-12-26 17:40:34 +00:00
parent 139e78e35c
commit d64ec6ee0d
7 changed files with 50 additions and 46 deletions

View File

@ -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,

View File

@ -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 ) {

View File

@ -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;

View File

@ -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,

View File

@ -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);

View File

@ -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

View File

@ -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,