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 )
return -5;
}
+ if( domain == NULL ) ndomain[0] = '\0';
+
strcat( ndomain, dc );
strcat( ndomain, "." );
}
}
+ /*
+ * 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;
}
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 );