]> git.sur5r.net Git - openldap/commitdiff
Fix minor bugs...
authorKurt Zeilenga <kurt@openldap.org>
Wed, 10 May 2000 22:21:57 +0000 (22:21 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 10 May 2000 22:21:57 +0000 (22:21 +0000)
libraries/libldap/dnssrv.c
servers/slapd/back-dnssrv/request.c

index 11e3ed5b00b8dedd06d654fc617d6eee24c2ea6b..a6f4e24b9c0e65fb2069f39af6cda46fd283628d 100644 (file)
@@ -64,7 +64,7 @@ int ldap_dn2domain(
 #define LDAP_DC "dc="
 #define LDAP_DCOID "0.9.2342.19200300.100.1.25="
 
 #define LDAP_DC "dc="
 #define LDAP_DCOID "0.9.2342.19200300.100.1.25="
 
-               if( *rdn[1] == NULL ) {
+               if( rdn[1] == NULL ) {
                        char *dc;
                        /* single RDN */
 
                        char *dc;
                        /* single RDN */
 
@@ -94,8 +94,9 @@ int ldap_dn2domain(
                                        return -4;
                                }
 
                                        return -4;
                                }
 
-                               ndomain = realloc( domain,
-                                       strlen(domain) + strlen(dc) + 2 );
+                               ndomain = LDAP_REALLOC( domain,
+                                       ( domain == NULL ? 0 : strlen(domain) )
+                                       + strlen(dc) + 2 );
 
                                if( ndomain == NULL ) {
                                        LDAP_FREE( rdn );
 
                                if( ndomain == NULL ) {
                                        LDAP_FREE( rdn );
index 963a9023df0da9f0de84cbe6c815c97c116d6665..bf91ab09822e0abc48770c2b08f903b1cd071a41 100644 (file)
@@ -34,16 +34,23 @@ dnssrv_back_request(
                        NULL, NULL, default_referral, NULL );
                goto done;
        }
                        NULL, NULL, default_referral, NULL );
                goto done;
        }
+
+       Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
+               dn == NULL ? "" : dn,
+               domain == NULL ? "" : domain,
+               0 );
        
        if( ldap_domain2hostlist( dn, &domain ) ) {
        
        if( ldap_domain2hostlist( dn, &domain ) ) {
+               Debug( LDAP_DEBUG_TRACE, "DNSSRV: no such object\n", 0, 0, 0 );
                send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT,
                send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT,
-                       NULL, NULL, NULL, NULL );
+                       NULL, "could not locate DNS SRV records", NULL, NULL );
                goto done;
        }
 
        hosts = str2charray( hostlist, " " );
 
        if( hosts == NULL ) {
                goto done;
        }
 
        hosts = str2charray( hostlist, " " );
 
        if( hosts == NULL ) {
+               Debug( LDAP_DEBUG_TRACE, "DNSSRV: str2charrary error\n", 0, 0, 0 );
                send_ldap_result( conn, op, LDAP_OTHER,
                        NULL, NULL, NULL, NULL );
                goto done;
                send_ldap_result( conn, op, LDAP_OTHER,
                        NULL, NULL, NULL, NULL );
                goto done;