From: Kurt Zeilenga Date: Wed, 10 May 2000 22:21:57 +0000 (+0000) Subject: Fix minor bugs... X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~3027 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fbb58dec533bac52005bd635988145e69b92a437;p=openldap Fix minor bugs... --- diff --git a/libraries/libldap/dnssrv.c b/libraries/libldap/dnssrv.c index 11e3ed5b00..a6f4e24b9c 100644 --- a/libraries/libldap/dnssrv.c +++ b/libraries/libldap/dnssrv.c @@ -64,7 +64,7 @@ int ldap_dn2domain( #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 */ @@ -94,8 +94,9 @@ int ldap_dn2domain( 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 ); diff --git a/servers/slapd/back-dnssrv/request.c b/servers/slapd/back-dnssrv/request.c index 963a9023df..bf91ab0982 100644 --- a/servers/slapd/back-dnssrv/request.c +++ b/servers/slapd/back-dnssrv/request.c @@ -34,16 +34,23 @@ dnssrv_back_request( 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 ) ) { + Debug( LDAP_DEBUG_TRACE, "DNSSRV: no such object\n", 0, 0, 0 ); 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 ) { + Debug( LDAP_DEBUG_TRACE, "DNSSRV: str2charrary error\n", 0, 0, 0 ); send_ldap_result( conn, op, LDAP_OTHER, NULL, NULL, NULL, NULL ); goto done;