]> git.sur5r.net Git - openldap/commitdiff
Return default referral if DN maps to empty domain.
authorKurt Zeilenga <kurt@openldap.org>
Thu, 26 Sep 2002 16:12:39 +0000 (16:12 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 26 Sep 2002 16:12:39 +0000 (16:12 +0000)
servers/slapd/back-dnssrv/referral.c
servers/slapd/back-dnssrv/search.c

index 4bd8fbe037827c2e57655f2fa87d86d335c9e1f6..9aaf23c79c84509c3fa8d649e7e85b27c6b7d285 100644 (file)
@@ -45,16 +45,14 @@ dnssrv_back_referrals(
                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,
                        NULL, NULL, default_referral, NULL );
                return LDAP_REFERRAL;
        }
 
        Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
-               dn->bv_val,
-               domain == NULL ? "" : domain,
-               0 );
+               dn->bv_val, domain, 0 );
 
        if( ( rc = ldap_domain2hostlist( domain, &hostlist ) ) ) {
                Debug( LDAP_DEBUG_TRACE,
index 1af13a27e4f4c73fd22427c432a779bd1d282dcd..2a831bb8f9d1bdcf883876b32fa9950315c74b40 100644 (file)
@@ -44,16 +44,14 @@ dnssrv_back_search(
 
        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,
                        NULL, NULL, default_referral, NULL );
                goto done;
        }
 
        Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
-               dn->bv_len ? dn->bv_val : "",
-               domain == NULL ? "" : domain,
-               0 );
+               dn->bv_len ? dn->bv_val : "", domain, 0 );
 
        if( ( rc = ldap_domain2hostlist( domain, &hostlist ) ) ) {
                Debug( LDAP_DEBUG_TRACE, "DNSSRV: domain2hostlist returned %d\n",