From 9f8c9bf3a86e8ef7343b51d60838520aed669cc8 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 26 Dec 2001 18:04:06 +0000 Subject: [PATCH] struct berval DN changes --- servers/slapd/back-dnssrv/referral.c | 21 +++++++++++---------- servers/slapd/back-shell/result.c | 8 ++++---- servers/slapd/back-shell/shell.h | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/servers/slapd/back-dnssrv/referral.c b/servers/slapd/back-dnssrv/referral.c index a1e483d945..619b5bac73 100644 --- a/servers/slapd/back-dnssrv/referral.c +++ b/servers/slapd/back-dnssrv/referral.c @@ -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 ); diff --git a/servers/slapd/back-shell/result.c b/servers/slapd/back-shell/result.c index 5516118adf..adfd86f59b 100644 --- a/servers/slapd/back-shell/result.c +++ b/servers/slapd/back-shell/result.c @@ -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 ); } } diff --git a/servers/slapd/back-shell/shell.h b/servers/slapd/back-shell/shell.h index bb72f0587f..c0ade1fd3e 100644 --- a/servers/slapd/back-shell/shell.h +++ b/servers/slapd/back-shell/shell.h @@ -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 -- 2.39.5