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, Backend *be,
Connection *conn, Connection *conn,
Operation *op, Operation *op,
const char *dn, struct berval *dn,
const char *ndn, struct berval *ndn,
const char **text ) const char **text )
{ {
int i; int i;
@ -31,7 +31,7 @@ dnssrv_back_referrals(
char **hosts = NULL; char **hosts = NULL;
struct berval **urls = NULL; struct berval **urls = NULL;
if( ndn == NULL || *ndn == '\0' ) { if( ndn->bv_len == 0 ) {
*text = "DNS SRV operation upon null (empty) DN disallowed"; *text = "DNS SRV operation upon null (empty) DN disallowed";
return LDAP_UNWILLING_TO_PERFORM; return LDAP_UNWILLING_TO_PERFORM;
} }
@ -45,20 +45,21 @@ dnssrv_back_referrals(
return LDAP_OTHER; return LDAP_OTHER;
} }
if( ldap_dn2domain( dn, &domain ) ) { if( ldap_dn2domain( dn->bv_val, &domain ) ) {
send_ldap_result( conn, op, LDAP_REFERRAL, send_ldap_result( conn, op, LDAP_REFERRAL,
NULL, NULL, default_referral, NULL ); NULL, NULL, default_referral, NULL );
return LDAP_REFERRAL; return LDAP_REFERRAL;
} }
Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n", Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
dn == NULL ? "" : dn, dn->bv_val,
domain == NULL ? "" : domain, domain == NULL ? "" : domain,
0 ); 0 );
if( rc = ldap_domain2hostlist( domain, &hostlist ) ) { if( rc = ldap_domain2hostlist( domain, &hostlist ) ) {
Debug( LDAP_DEBUG_TRACE, "DNSSRV: domain2hostlist returned %d\n", Debug( LDAP_DEBUG_TRACE,
rc, 0, 0 ); "DNSSRV: domain2hostlist(%s) returned %d\n",
domain, rc, 0 );
*text = "no DNS SRV RR available for DN"; *text = "no DNS SRV RR available for DN";
rc = LDAP_NO_SUCH_OBJECT; rc = LDAP_NO_SUCH_OBJECT;
goto done; goto done;
@ -90,11 +91,11 @@ dnssrv_back_referrals(
Statslog( LDAP_DEBUG_STATS, Statslog( LDAP_DEBUG_STATS,
"conn=%ld op=%d DNSSRV p=%d dn=\"%s\" url=\"%s\"\n", "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", Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> url=\"%s\"\n",
dn == NULL ? "" : dn, dn->bv_val, urls[0]->bv_val, 0 );
urls[0]->bv_val, 0 );
send_ldap_result( conn, op, rc = LDAP_REFERRAL, send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, "DNS SRV generated referrals", urls, NULL ); NULL, "DNS SRV generated referrals", urls, NULL );

View file

@ -23,7 +23,7 @@ read_and_send_results(
Connection *conn, Connection *conn,
Operation *op, Operation *op,
FILE *fp, FILE *fp,
char **attrs, struct berval **attrs,
int attrsonly int attrsonly
) )
{ {
@ -82,8 +82,8 @@ read_and_send_results(
Debug( LDAP_DEBUG_ANY, "str2entry(%s) failed\n", Debug( LDAP_DEBUG_ANY, "str2entry(%s) failed\n",
buf, 0, 0 ); buf, 0, 0 );
} else { } else {
send_search_entry( be, conn, op, e, attrs, send_search_entry( be, conn, op, e,
attrsonly, NULL ); attrs, attrsonly, NULL );
entry_free( e ); entry_free( e );
} }
@ -111,6 +111,6 @@ print_suffixes(
int i; int i;
for ( i = 0; be->be_suffix[i] != NULL; 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_conn *conn,
struct slap_op *op, struct slap_op *op,
FILE *fp, FILE *fp,
char **attrs, struct berval **attrs,
int attrsonly)); int attrsonly));
LDAP_END_DECL LDAP_END_DECL