mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Return default referral if DN maps to empty domain.
This commit is contained in:
parent
b4e1ea15f3
commit
4ef4c9eb06
@ -45,16 +45,14 @@ dnssrv_back_referrals(
|
|||||||
return LDAP_OTHER;
|
return LDAP_OTHER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ldap_dn2domain( dn->bv_val, &domain ) ) {
|
if( ldap_dn2domain( dn->bv_val, &domain ) || domain == NULL ) {
|
||||||
send_ldap_result( conn, op, LDAP_REFERRAL,
|
send_ldap_result( conn, op, LDAP_REFERRAL,
|
||||||
NULL, NULL, default_referral, NULL );
|
NULL, NULL, default_referral, NULL );
|
||||||
return LDAP_REFERRAL;
|
return LDAP_REFERRAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
|
Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
|
||||||
dn->bv_val,
|
dn->bv_val, domain, 0 );
|
||||||
domain == NULL ? "" : domain,
|
|
||||||
0 );
|
|
||||||
|
|
||||||
if( ( rc = ldap_domain2hostlist( domain, &hostlist ) ) ) {
|
if( ( rc = ldap_domain2hostlist( domain, &hostlist ) ) ) {
|
||||||
Debug( LDAP_DEBUG_TRACE,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
|
@ -44,16 +44,14 @@ dnssrv_back_search(
|
|||||||
|
|
||||||
assert( get_manageDSAit( op ) );
|
assert( get_manageDSAit( op ) );
|
||||||
|
|
||||||
if( ldap_dn2domain( dn->bv_val, &domain ) ) {
|
if( ldap_dn2domain( dn->bv_val, &domain ) || domain == NULL ) {
|
||||||
send_ldap_result( conn, op, LDAP_REFERRAL,
|
send_ldap_result( conn, op, LDAP_REFERRAL,
|
||||||
NULL, NULL, default_referral, NULL );
|
NULL, NULL, default_referral, NULL );
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
|
Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
|
||||||
dn->bv_len ? dn->bv_val : "",
|
dn->bv_len ? dn->bv_val : "", domain, 0 );
|
||||||
domain == NULL ? "" : domain,
|
|
||||||
0 );
|
|
||||||
|
|
||||||
if( ( rc = ldap_domain2hostlist( domain, &hostlist ) ) ) {
|
if( ( rc = ldap_domain2hostlist( domain, &hostlist ) ) ) {
|
||||||
Debug( LDAP_DEBUG_TRACE, "DNSSRV: domain2hostlist returned %d\n",
|
Debug( LDAP_DEBUG_TRACE, "DNSSRV: domain2hostlist returned %d\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user