Commit 1bc5314d authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fix DNSSRV initialization bug

parent b8af4a67
......@@ -61,12 +61,15 @@ int ldap_dn2domain(
return -3;
}
#define LDAP_DC "dc="
#define LDAP_DCOID "0.9.2342.19200300.100.1.25="
if( rdn[1] == NULL ) {
/*
* single-valued RDN
*/
char *dc;
/* single RDN */
#define LDAP_DC "dc="
#define LDAP_DCOID "0.9.2342.19200300.100.1.25="
if( strncasecmp( rdn[0],
LDAP_DC, sizeof(LDAP_DC)-1 ) == 0 )
......@@ -106,6 +109,8 @@ int ldap_dn2domain(
return -5;
}
if( domain == NULL ) ndomain[0] = '\0';
strcat( ndomain, dc );
strcat( ndomain, "." );
......@@ -114,11 +119,20 @@ int ldap_dn2domain(
}
}
/*
* multi-valued RDN or fall thru
*/
LDAP_VFREE( rdn );
LDAP_FREE( domain );
domain = NULL;
}
if( domain != NULL && *domain == '\0' ) {
LDAP_FREE( domain );
domain = NULL;
}
*domainp = domain;
return 0;
}
......
......@@ -40,7 +40,7 @@ dnssrv_back_request(
dn == NULL ? "" : dn,
domain == NULL ? "" : domain,
0 );
if( rc = ldap_domain2hostlist( domain, &hostlist ) ) {
Debug( LDAP_DEBUG_TRACE, "DNSSRV: domain2hostlist returned %d\n",
rc, 0, 0 );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment