struct berval DN changes

This commit is contained in:
Kurt Zeilenga 2001-12-26 18:04:06 +00:00
parent df9cc9da58
commit 9f8c9bf3a8
3 changed files with 16 additions and 15 deletions

View File

@ -20,8 +20,8 @@ dnssrv_back_referrals(
Backend *be,
Connection *conn,
Operation *op,
const char *dn,
const char *ndn,
struct berval *dn,
struct berval *ndn,
const char **text )
{
int i;
@ -31,7 +31,7 @@ dnssrv_back_referrals(
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;
}
@ -45,20 +45,21 @@ dnssrv_back_referrals(
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;
@ -90,11 +91,11 @@ dnssrv_back_referrals(
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 );

View File

@ -23,7 +23,7 @@ read_and_send_results(
Connection *conn,
Operation *op,
FILE *fp,
char **attrs,
struct berval **attrs,
int attrsonly
)
{
@ -82,8 +82,8 @@ read_and_send_results(
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 );
}
@ -111,6 +111,6 @@ print_suffixes(
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 );
}
}

View File

@ -42,7 +42,7 @@ extern int read_and_send_results LDAP_P((
struct slap_conn *conn,
struct slap_op *op,
FILE *fp,
char **attrs,
struct berval **attrs,
int attrsonly));
LDAP_END_DECL