Backend *be,
Connection *conn,
Operation *op,
- const char *dn,
- const char *ndn,
+ struct berval *dn,
+ struct berval *ndn,
const char **text )
{
int i;
char **hosts = NULL;
struct berval **urls = NULL;
- if( ndn == NULL || *ndn == '\0' ) {
+ if( ndn->bv_len == 0 ) {
*text = "DNS SRV operation upon null (empty) DN disallowed";
return LDAP_UNWILLING_TO_PERFORM;
}
return LDAP_OTHER;
}
- if( ldap_dn2domain( dn, &domain ) ) {
+ if( ldap_dn2domain( dn->bv_val, &domain ) ) {
send_ldap_result( conn, op, LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
return LDAP_REFERRAL;
}
Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
- dn == NULL ? "" : dn,
+ dn->bv_val,
domain == NULL ? "" : domain,
0 );
if( rc = ldap_domain2hostlist( domain, &hostlist ) ) {
- Debug( LDAP_DEBUG_TRACE, "DNSSRV: domain2hostlist returned %d\n",
- rc, 0, 0 );
+ Debug( LDAP_DEBUG_TRACE,
+ "DNSSRV: domain2hostlist(%s) returned %d\n",
+ domain, rc, 0 );
*text = "no DNS SRV RR available for DN";
rc = LDAP_NO_SUCH_OBJECT;
goto done;
Statslog( LDAP_DEBUG_STATS,
"conn=%ld op=%d DNSSRV p=%d dn=\"%s\" url=\"%s\"\n",
- op->o_connid, op->o_opid, op->o_protocol, dn, urls[0]->bv_val );
+ op->o_connid, op->o_opid, op->o_protocol,
+ dn->bv_val, urls[0]->bv_val );
Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> url=\"%s\"\n",
- dn == NULL ? "" : dn,
- urls[0]->bv_val, 0 );
+ dn->bv_val, urls[0]->bv_val, 0 );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, "DNS SRV generated referrals", urls, NULL );
Connection *conn,
Operation *op,
FILE *fp,
- char **attrs,
+ struct berval **attrs,
int attrsonly
)
{
Debug( LDAP_DEBUG_ANY, "str2entry(%s) failed\n",
buf, 0, 0 );
} else {
- send_search_entry( be, conn, op, e, attrs,
- attrsonly, NULL );
+ send_search_entry( be, conn, op, e,
+ attrs, attrsonly, NULL );
entry_free( e );
}
int i;
for ( i = 0; be->be_suffix[i] != NULL; i++ ) {
- fprintf( fp, "suffix: %s\n", be->be_suffix[i].bv_val );
+ fprintf( fp, "suffix: %s\n", be->be_suffix[i]->bv_val );
}
}