]> git.sur5r.net Git - openldap/commitdiff
struct berval DN changes
authorKurt Zeilenga <kurt@openldap.org>
Wed, 26 Dec 2001 18:04:06 +0000 (18:04 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 26 Dec 2001 18:04:06 +0000 (18:04 +0000)
servers/slapd/back-dnssrv/referral.c
servers/slapd/back-shell/result.c
servers/slapd/back-shell/shell.h

index a1e483d9457d76c9eebfc93c98f6735c3442816a..619b5bac7300637c75f68e03246220faae849ffd 100644 (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 );
index 5516118adf007e15ccd41a7dfbd696dfe2f4f7da..adfd86f59bf5769a4eccf1c5912239b6fd3ebdf0 100644 (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 );
        }
 }
index bb72f0587fb88964ebc2378e50e77bad28c7f09d..c0ade1fd3ebfd137a1cd5535e0aeab4ce6393e81 100644 (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