char *domain = NULL;
char *hostlist = NULL;
char **hosts = NULL;
- char *refdn, *nrefdn;
+ char *refdn;
+ struct berval *nrefdn = NULL;
struct berval **urls = NULL;
assert( get_manageDSAit( op ) );
NULL, "DNS SRV problem processing manageDSAit control",
NULL, NULL );
goto done;
- }
- nrefdn = ch_strdup( refdn );
- dn_normalize(nrefdn);
+ } else {
+ struct berval bv;
+ bv.bv_val = refdn;
+ bv.bv_len = strlen( refdn );
+
+ rc = dnNormalize( NULL, &bv, &nrefdn );
+ if( rc != LDAP_SUCCESS ) {
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "DNS SRV problem processing manageDSAit control",
+ NULL, NULL );
+ goto done;
+ }
+ }
- if( strcmp( nrefdn, ndn->bv_val ) != 0 ) {
+ if( strcmp( nrefdn->bv_val, ndn->bv_val ) != 0 ) {
/* requested dn is subordinate */
Debug( LDAP_DEBUG_TRACE,
}
free( refdn );
- free( nrefdn );
+ ber_bvfree( nrefdn );
done:
if( domain != NULL ) ch_free( domain );
attr_merge(e, ad_description, vals);
s = strchr(val.bv_val, ',');
- if (s)
- *s = '\0';
+ if (s) *s = '\0';
+
s = strchr(val.bv_val, '&');
if (s) {
+ char buf[256];
int i = s - val.bv_val;
strncpy(buf, val.bv_val, i);
s = buf+i;