Commit 82fad7d0 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

First stable an implementing latest namedref specification.

Includes rewriting of URLs where the DN of the referral object
and the DN of the ref attribute attribute are not the same.
Also, always returns explicit DN and scope.
Currently, back-ldbm only.  Needs to be ported to back-bdb.
parent f3f72c5d
......@@ -17,7 +17,7 @@ SRCS = main.c daemon.c connection.c search.c filter.c add.c charray.c \
repl.c lock.c controls.c extended.c kerberos.c passwd.c \
schema.c schema_check.c schema_init.c schema_prep.c \
schemaparse.c ad.c at.c mr.c syntax.c oc.c saslauthz.c \
configinfo.c starttls.c index.c sets.c \
configinfo.c starttls.c index.c sets.c referral.c \
root_dse.c sasl.c module.c suffixalias.c mra.c mods.c \
limits.c \
$(@PLAT@_SRCS)
......@@ -30,7 +30,7 @@ OBJS = main.o daemon.o connection.o search.o filter.o add.o charray.o \
repl.o lock.o controls.o extended.o kerberos.o passwd.o \
schema.o schema_check.o schema_init.o schema_prep.o \
schemaparse.o ad.o at.o mr.o syntax.o oc.o saslauthz.o \
configinfo.o starttls.o index.o sets.o \
configinfo.o starttls.o index.o sets.o referral.o \
root_dse.o sasl.o module.o suffixalias.o mra.o mods.o \
limits.o \
$(@PLAT@_OBJS)
......
......@@ -209,8 +209,13 @@ do_add( Connection *conn, Operation *op )
*/
be = select_backend( e->e_ndn, manageDSAit );
if ( be == NULL ) {
struct berval **ref = referral_rewrite( default_referral,
NULL, e->e_dn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
NULL, NULL, ref ? ref : default_referral, NULL );
ber_bvecfree( ref );
goto done;
}
......@@ -294,8 +299,15 @@ do_add( Connection *conn, Operation *op )
#ifndef SLAPD_MULTIMASTER
} else {
struct berval **defref = be->be_update_refs
? be->be_update_refs : default_referral;
struct berval **ref = referral_rewrite( defref,
NULL, e->e_dn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL, NULL, NULL,
be->be_update_refs ? be->be_update_refs : default_referral, NULL );
ref ? ref : defref, NULL );
ber_bvecfree( ref );
#endif
}
} else {
......@@ -387,4 +399,3 @@ static int slap_mods2entry(
return LDAP_SUCCESS;
}
......@@ -37,12 +37,11 @@ ldbm_back_add(
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,"ldbm_back_add: %s\n",
e->e_dn ));
e->e_dn ));
#else
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", e->e_dn, 0, 0);
#endif
/* nobody else can add until we lock our parent */
ldap_pvt_thread_mutex_lock(&li->li_add_mutex);
......@@ -62,8 +61,8 @@ ldbm_back_add(
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_back_add: entry (%s) failed schema check.\n",
e->e_dn ));
"ldbm_back_add: entry (%s) failed schema check.\n",
e->e_dn ));
#else
Debug( LDAP_DEBUG_TRACE, "entry failed schema check: %s\n",
text, 0, 0 );
......@@ -90,7 +89,7 @@ ldbm_back_add(
/* get parent with writer lock */
if ( (p = dn2entry_w( be, pdn, &matched )) == NULL ) {
char *matched_dn;
char *matched_dn = NULL;
struct berval **refs;
ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
......@@ -98,33 +97,31 @@ ldbm_back_add(
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
? get_entry_referrals( be, conn, op, matched,
e->e_dn, LDAP_SCOPE_DEFAULT )
: NULL;
cache_return_entry_r( &li->li_cache, matched );
} else {
matched_dn = NULL;
refs = default_referral;
refs = referral_rewrite( default_referral,
NULL, e->e_dn, LDAP_SCOPE_DEFAULT );
}
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_back_add: Parent of (%s) does not exist.\n",
e->e_dn ));
"ldbm_back_add: Parent of (%s) does not exist.\n",
e->e_dn ));
#else
Debug( LDAP_DEBUG_TRACE, "parent does not exist\n",
0, 0, 0 );
#endif
send_ldap_result( conn, op, LDAP_REFERRAL, matched_dn,
refs == NULL ? "parent does not exist" : "parent is referral",
refs, NULL );
if( matched != NULL ) {
ber_bvecfree( refs );
free( matched_dn );
}
ber_bvecfree( refs );
free( matched_dn );
free( pdn );
return -1;
......@@ -182,7 +179,8 @@ ldbm_back_add(
/* parent is a referral, don't allow add */
char *matched_dn = ch_strdup( p->e_dn );
struct berval **refs = is_entry_referral( p )
? get_entry_referrals( be, conn, op, p )
? get_entry_referrals( be, conn, op, p,
e->e_dn, LDAP_SCOPE_DEFAULT )
: NULL;
/* free parent and writer lock */
......@@ -290,7 +288,6 @@ ldbm_back_add(
0 );
#endif
send_ldap_result( conn, op,
rc > 0 ? LDAP_ALREADY_EXISTS : LDAP_OTHER,
NULL, rc > 0 ? NULL : "cache add failed", NULL, NULL );
......
......@@ -45,7 +45,7 @@ ldbm_back_bind(
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
"ldbm_back_bind: dn: %s.\n", dn ));
"ldbm_back_bind: dn: %s.\n", dn ));
#else
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_bind: dn: %s\n", dn, 0, 0);
#endif
......@@ -63,12 +63,15 @@ ldbm_back_bind(
matched_dn = ch_strdup( matched->e_dn );
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
? get_entry_referrals( be, conn, op, matched,
dn, LDAP_SCOPE_DEFAULT )
: NULL;
cache_return_entry_r( &li->li_cache, matched );
} else {
refs = default_referral;
refs = referral_rewrite( default_referral,
NULL, dn, LDAP_SCOPE_DEFAULT );
}
/* allow noauth binds */
......@@ -96,10 +99,8 @@ ldbm_back_bind(
NULL, NULL, NULL, NULL );
}
if ( matched != NULL ) {
ber_bvecfree( refs );
free( matched_dn );
}
ber_bvecfree( refs );
free( matched_dn );
return( rc );
}
......@@ -128,7 +129,7 @@ ldbm_back_bind(
if ( is_entry_referral( e ) ) {
/* entry is a referral, don't allow bind */
struct berval **refs = get_entry_referrals( be,
conn, op, e );
conn, op, e, dn, LDAP_SCOPE_DEFAULT );
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
......
......@@ -41,20 +41,20 @@ ldbm_back_compare(
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
? get_entry_referrals( be, conn, op, matched,
dn, LDAP_SCOPE_DEFAULT )
: NULL;
cache_return_entry_r( &li->li_cache, matched );
} else {
refs = default_referral;
refs = referral_rewrite( default_referral,
NULL, dn, LDAP_SCOPE_DEFAULT );
}
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
if( matched != NULL ) {
ber_bvecfree( refs );
free( matched_dn );
}
ber_bvecfree( refs );
free( matched_dn );
return( 1 );
}
......@@ -62,7 +62,7 @@ ldbm_back_compare(
if (!manageDSAit && is_entry_referral( e ) ) {
/* entry is a referral, don't allow add */
struct berval **refs = get_entry_referrals( be,
conn, op, e );
conn, op, e, dn, LDAP_SCOPE_DEFAULT );
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
......
......@@ -36,43 +36,42 @@ ldbm_back_delete(
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
"ldbm_back_delete: %s\n", dn ));
"ldbm_back_delete: %s\n", dn ));
#else
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_delete: %s\n", dn, 0, 0);
#endif
/* get entry with writer lock */
if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char *matched_dn = NULL;
struct berval **refs = NULL;
struct berval **refs;
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_delete: no such object %s\n", dn ));
"ldbm_back_delete: no such object %s\n", dn ));
#else
Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: no such object %s\n",
dn, 0, 0);
#endif
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
? get_entry_referrals( be, conn, op, matched,
dn, LDAP_SCOPE_DEFAULT )
: NULL;
cache_return_entry_r( &li->li_cache, matched );
} else {
refs = default_referral;
refs = referral_rewrite( default_referral,
NULL, dn, LDAP_SCOPE_DEFAULT );
}
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
if ( matched != NULL ) {
ber_bvecfree( refs );
free( matched_dn );
}
ber_bvecfree( refs );
free( matched_dn );
return( -1 );
}
......@@ -81,7 +80,7 @@ ldbm_back_delete(
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
struct berval **refs = get_entry_referrals( be,
conn, op, e );
conn, op, e, dn, LDAP_SCOPE_DEFAULT );
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
......
......@@ -46,7 +46,7 @@ int ldbm_modify_internal(
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
"ldbm_modify_internal: %s\n", dn ));
"ldbm_modify_internal: %s\n", dn ));
#else
Debug(LDAP_DEBUG_TRACE, "ldbm_modify_internal: %s\n", dn, 0, 0);
#endif
......@@ -66,7 +66,7 @@ int ldbm_modify_internal(
case LDAP_MOD_ADD:
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"ldbm_modify_internal: add\n" ));
"ldbm_modify_internal: add\n" ));
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: add\n", 0, 0, 0);
#endif
......@@ -77,8 +77,8 @@ int ldbm_modify_internal(
*text = "modify: add values failed";
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_modify_internal: failed %d (%s)\n",
err, *text ));
"ldbm_modify_internal: failed %d (%s)\n",
err, *text ));
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
err, *text, 0);
......@@ -89,7 +89,7 @@ int ldbm_modify_internal(
case LDAP_MOD_DELETE:
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"ldbm_modify_internal: delete\n" ));
"ldbm_modify_internal: delete\n" ));
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: delete\n", 0, 0, 0);
#endif
......@@ -100,7 +100,7 @@ int ldbm_modify_internal(
*text = "modify: delete values failed";
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_modify_internal: failed %d (%s)\n", err, *text ));
"ldbm_modify_internal: failed %d (%s)\n", err, *text ));
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
err, *text, 0);
......@@ -111,7 +111,7 @@ int ldbm_modify_internal(
case LDAP_MOD_REPLACE:
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"ldbm_modify_internal: replace\n" ));
"ldbm_modify_internal: replace\n" ));
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: replace\n", 0, 0, 0);
#endif
......@@ -122,7 +122,7 @@ int ldbm_modify_internal(
*text = "modify: replace values failed";
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_modify_internal: failed %d (%s)\n", err, *text ));
"ldbm_modify_internal: failed %d (%s)\n", err, *text ));
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
err, *text, 0);
......@@ -134,7 +134,7 @@ int ldbm_modify_internal(
case SLAP_MOD_SOFTADD:
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"ldbm_modify_internal: softadd\n" ));
"ldbm_modify_internal: softadd\n" ));
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: softadd\n", 0, 0, 0);
#endif
......@@ -165,7 +165,7 @@ int ldbm_modify_internal(
default:
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_modify_internal: invalid op %d\n", mod->sm_op ));
"ldbm_modify_internal: invalid op %d\n", mod->sm_op ));
#else
Debug(LDAP_DEBUG_ANY, "ldbm_modify_internal: invalid op %d\n",
mod->sm_op, 0, 0);
......@@ -175,7 +175,7 @@ int ldbm_modify_internal(
*text = "Invalid modify operation";
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_modify_internal: %d (%s)\n", err, *text ));
"ldbm_modify_internal: %d (%s)\n", err, *text ));
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
err, *text, 0);
......@@ -208,8 +208,8 @@ int ldbm_modify_internal(
e->e_attrs = save_attrs;
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_modify_internal: entry failed schema check: %s\n",
*text ));
"ldbm_modify_internal: entry failed schema check: %s\n",
*text ));
#else
Debug( LDAP_DEBUG_ANY, "entry failed schema check: %s\n",
*text, 0, 0 );
......@@ -261,7 +261,7 @@ ldbm_back_modify(
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
"ldbm_back_modify: enter\n" ));
"ldbm_back_modify: enter\n" ));
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0);
#endif
......@@ -270,25 +270,25 @@ ldbm_back_modify(
/* acquire and lock entry */
if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char* matched_dn = NULL;
struct berval **refs = NULL;
struct berval **refs;
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
? get_entry_referrals( be, conn, op, matched,
dn, LDAP_SCOPE_DEFAULT )
: NULL;
cache_return_entry_r( &li->li_cache, matched );
} else {
refs = default_referral;
refs = referral_rewrite( default_referral,
NULL, dn, LDAP_SCOPE_DEFAULT );
}
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
if ( matched != NULL ) {
ber_bvecfree( refs );
free( matched_dn );
}
ber_bvecfree( refs );
free( matched_dn );
return( -1 );
}
......@@ -297,7 +297,7 @@ ldbm_back_modify(
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
struct berval **refs = get_entry_referrals( be,
conn, op, e );
conn, op, e, dn, LDAP_SCOPE_DEFAULT );
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
......
......@@ -77,36 +77,36 @@ ldbm_back_modrdn(
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
"ldbm_back_modrdn: dn: %s newSuperior=%s\n",
dn ? dn : "NULL", newSuperior ? newSuperior : "NULL" ));
"ldbm_back_modrdn: dn: %s newSuperior=%s\n",
dn ? dn : "NULL", newSuperior ? newSuperior : "NULL" ));
#else
Debug( LDAP_DEBUG_TRACE, "==>ldbm_back_modrdn(newSuperior=%s)\n",
(newSuperior ? newSuperior : "NULL"),
0, 0 );
(newSuperior ? newSuperior : "NULL"),
0, 0 );
#endif
/* get entry with writer lock */
if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char* matched_dn = NULL;
struct berval** refs = NULL;
struct berval** refs;
if( matched != NULL ) {
matched_dn = strdup( matched->e_dn );
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
? get_entry_referrals( be, conn, op, matched,
dn, LDAP_SCOPE_DEFAULT )
: NULL;
cache_return_entry_r( &li->li_cache, matched );
} else {
refs = default_referral;
refs = referral_rewrite( default_referral,
NULL, dn, LDAP_SCOPE_DEFAULT );
}
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
if ( matched != NULL ) {
ber_bvecfree( refs );
free( matched_dn );
}
ber_bvecfree( refs );
free( matched_dn );
return( -1 );
}
......@@ -115,13 +115,13 @@ ldbm_back_modrdn(
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
struct berval **refs = get_entry_referrals( be,
conn, op, e );
conn, op, e, dn, LDAP_SCOPE_DEFAULT );
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_modrdn: entry %s is a referral\n", e->e_dn ));
"ldbm_back_modrdn: entry %s is a referral\n", e->e_dn ));
#else
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
Debug( LDAP_DEBUG_TRACE, "entry %s is referral\n", e->e_dn,
0, 0 );
#endif
......@@ -135,9 +135,9 @@ ldbm_back_modrdn(
if ( has_children( be, e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_modrdn: entry %s has children\n", e->e_dn ));
"ldbm_back_modrdn: entry %s has children\n", e->e_dn ));
#else
Debug( LDAP_DEBUG_TRACE, "entry %s referral\n", e->e_dn,
Debug( LDAP_DEBUG_TRACE, "entry %s has children\n", e->e_dn,
0, 0 );
#endif
......@@ -154,7 +154,7 @@ ldbm_back_modrdn(
if( (p = dn2entry_w( be, p_ndn, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_modrdn: parent of %s does not exist\n", e->e_ndn ));
"ldbm_back_modrdn: parent of %s does not exist\n", e->e_ndn ));
#else
Debug( LDAP_DEBUG_TRACE, "parent does not exist\n",
0, 0, 0);
......@@ -334,11 +334,11 @@ ldbm_back_modrdn(
/* parent is an alias, don't allow add */
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_modrdn: entry (%s) is a referral\n",
np->e_dn ));
"ldbm_back_modrdn: entry (%s) is a referral\n",
np->e_dn ));
#else
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
0, 0 );
Debug( LDAP_DEBUG_TRACE, "entry (%s) is referral\n",
np->e_dn, 0, 0 );
#endif
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
......@@ -349,11 +349,11 @@ ldbm_back_modrdn(
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"ldbm_back_modrdn: wr to new parent's children OK.\n" ));
"ldbm_back_modrdn: wr to new parent's children OK.\n" ));
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: wr to new parent's children OK\n",
0, 0 , 0 );
"ldbm_back_modrdn: wr to new parent's children OK\n",
0, 0, 0 );
#endif
new_parent_dn = np_dn;
......@@ -367,10 +367,10 @@ ldbm_back_modrdn(
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"ldbm_back_modrdn: new ndn=%s\n", new_ndn ));
"ldbm_back_modrdn: new ndn=%s\n", new_ndn ));
#else
Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: new ndn=%s\n",
new_ndn, 0, 0 );
new_ndn, 0, 0 );
#endif
/* check for abandon */
......
......@@ -42,65 +42,80 @@ ldbm_back_referrals(
e = dn2entry_r( be, ndn, &matched );
if ( e == NULL ) {
char *matched_dn = NULL;
struct berval **refs = default_referral;
struct berval **refs = NULL;
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
#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 ));
"ldbm_back_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
op->o_tag, dn, matched_dn ));
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
op->o_tag, dn, matched_dn );
#endif
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
: NULL;
if( is_entry_referral( matched ) ) {
rc = LDAP_OTHER;
refs = get_entry_referrals( be, conn, op, matched,
dn, LDAP_SCOPE_DEFAULT );
}
cache_return_entry_r( &li->li_cache, matched );
} else if ( default_referral != NULL ) {
rc = LDAP_OTHER;
refs = referral_rewrite( default_referral,
NULL, dn, LDAP_SCOPE_DEFAULT );
}
if( refs != NULL ) {
/* send referrals */
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
}
if( matched != NULL ) {