]> git.sur5r.net Git - openldap/commitdiff
modify be_referral to use struct berval DNs.
authorKurt Zeilenga <kurt@openldap.org>
Wed, 26 Dec 2001 17:40:34 +0000 (17:40 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 26 Dec 2001 17:40:34 +0000 (17:40 +0000)
servers/slapd/back-bdb/referral.c
servers/slapd/back-ldbm/referral.c
servers/slapd/back-monitor/init.c
servers/slapd/backend.c
servers/slapd/backglue.c
servers/slapd/libslapd.dsp
servers/slapd/slap.h

index c32522d2dc1ec4f180685766204b01c8f438bb11..c02b78b1a79459b00653115d8dbc0dd8c69addb2 100644 (file)
@@ -17,8 +17,8 @@ bdb_referrals(
        BackendDB       *be,
        Connection      *conn,
        Operation       *op,
-       const char *dn,
-       const char *ndn,
+       struct berval *dn,
+       struct berval *ndn,
        const char **text )
 {
        struct bdb_info *bdb = (struct bdb_info *) be->be_private;
@@ -36,7 +36,7 @@ bdb_referrals(
        } 
 
        /* get entry */
-       rc = bdb_dn2entry( be, NULL, ndn, &e, &matched, 0 );
+       rc = bdb_dn2entry( be, NULL, ndn->bv_val, &e, &matched, 0 );
 
        switch(rc) {
        case DB_NOTFOUND:
@@ -66,7 +66,7 @@ bdb_referrals(
                        if( is_entry_referral( matched ) ) {
                                rc = LDAP_OTHER;
                                refs = get_entry_referrals( be, conn, op,
-                                       matched, dn, LDAP_SCOPE_DEFAULT );
+                                       matched, dn->bv_val, LDAP_SCOPE_DEFAULT );
                        }
 
                        bdb_entry_return( be, matched );
@@ -74,7 +74,7 @@ bdb_referrals(
                } else if ( default_referral != NULL ) {
                        rc = LDAP_OTHER;
                        refs = referral_rewrite( default_referral,
-                               NULL, dn, LDAP_SCOPE_DEFAULT );
+                               NULL, dn->bv_val, LDAP_SCOPE_DEFAULT );
                }
 
                if( refs != NULL ) {
@@ -95,13 +95,13 @@ bdb_referrals(
        if ( is_entry_referral( e ) ) {
                /* entry is a referral */
                struct berval **refs = get_entry_referrals( be,
-                       conn, op, e, dn, LDAP_SCOPE_DEFAULT );
+                       conn, op, e, dn->bv_val, LDAP_SCOPE_DEFAULT );
                struct berval **rrefs = referral_rewrite(
-                       refs, e->e_dn, dn, LDAP_SCOPE_DEFAULT );
+                       refs, e->e_dn, dn->bv_val, LDAP_SCOPE_DEFAULT );
 
                Debug( LDAP_DEBUG_TRACE,
                        "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
-                       (long) op->o_tag, dn, e->e_dn );
+                       (long) op->o_tag, dn->bv_val, e->e_dn );
 
                if( rrefs != NULL ) {
                        send_ldap_result( conn, op, rc = LDAP_REFERRAL,
index ae80f3617f129d58df96b3cfdcfe9a8b4931f8df..468d79b870546d2e0cc798a58ecea4fd6374ffc6 100644 (file)
@@ -20,8 +20,8 @@ ldbm_back_referrals(
     Backend    *be,
     Connection *conn,
     Operation  *op,
-    const char *dn,
-    const char *ndn,
+    struct berval *dn,
+    struct berval *ndn,
        const char **text )
 {
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
@@ -39,7 +39,7 @@ ldbm_back_referrals(
        } 
 
        /* get entry with reader lock */
-       e = dn2entry_r( be, ndn, &matched );
+       e = dn2entry_r( be, ndn->bv_val, &matched );
        if ( e == NULL ) {
                char *matched_dn = NULL;
                struct berval **refs = NULL;
@@ -50,17 +50,17 @@ ldbm_back_referrals(
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
                                "ldbm_back_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
-                               op->o_tag, dn, matched_dn ));
+                               op->o_tag, dn->bv_val, matched_dn ));
 #else
                        Debug( LDAP_DEBUG_TRACE,
                                "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
-                               op->o_tag, dn, matched_dn );
+                               op->o_tag, dn->bv_val, matched_dn );
 #endif
 
                        if( is_entry_referral( matched ) ) {
                                rc = LDAP_OTHER;
                                refs = get_entry_referrals( be, conn, op, matched,
-                                       dn, LDAP_SCOPE_DEFAULT );
+                                       dn->bv_val, LDAP_SCOPE_DEFAULT );
                        }
 
                        cache_return_entry_r( &li->li_cache, matched );
@@ -68,7 +68,7 @@ ldbm_back_referrals(
                } else if ( default_referral != NULL ) {
                        rc = LDAP_OTHER;
                        refs = referral_rewrite( default_referral,
-                               NULL, dn, LDAP_SCOPE_DEFAULT );
+                               NULL, dn->bv_val, LDAP_SCOPE_DEFAULT );
                }
 
                if( refs != NULL ) {
@@ -90,18 +90,18 @@ ldbm_back_referrals(
        if ( is_entry_referral( e ) ) {
                /* entry is a referral */
                struct berval **refs = get_entry_referrals( be,
-                       conn, op, e, dn, LDAP_SCOPE_DEFAULT );
+                       conn, op, e, dn->bv_val, LDAP_SCOPE_DEFAULT );
                struct berval **rrefs = referral_rewrite(
-                       refs, e->e_dn, dn, LDAP_SCOPE_DEFAULT );
+                       refs, e->e_dn, dn->bv_val, LDAP_SCOPE_DEFAULT );
 
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
                        "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
-                       op->o_tag, dn, e->e_dn ));
+                       op->o_tag, dn->bv_val, e->e_dn ));
 #else
                Debug( LDAP_DEBUG_TRACE,
                        "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
-                       op->o_tag, dn, e->e_dn );
+                       op->o_tag, dn->bv_val, e->e_dn );
 #endif
 
                if( rrefs != NULL ) {
index 6f214178aedea8e5ef0847ce20fa9f9ed87fc6df..862683641f6574fbe44716ae0664d4ce43285a9b 100644 (file)
@@ -162,47 +162,47 @@ monitor_back_initialize(
 
        bi->bi_controls = controls;
 
-       bi->bi_init = NULL;
+       bi->bi_init = 0;
        bi->bi_open = monitor_back_open;
        bi->bi_config = monitor_back_config;
-       bi->bi_close = NULL;
-       bi->bi_destroy = NULL;
+       bi->bi_close = 0;
+       bi->bi_destroy = 0;
 
        bi->bi_db_init = monitor_back_db_init;
        bi->bi_db_config = monitor_back_db_config;
-       bi->bi_db_open = NULL;
-       bi->bi_db_close = NULL;
+       bi->bi_db_open = 0;
+       bi->bi_db_close = 0;
        bi->bi_db_destroy = monitor_back_db_destroy;
 
        bi->bi_op_bind = monitor_back_bind;
-       bi->bi_op_unbind = NULL;
+       bi->bi_op_unbind = 0;
        bi->bi_op_search = monitor_back_search;
        bi->bi_op_compare = monitor_back_compare;
        bi->bi_op_modify = monitor_back_modify;
-       bi->bi_op_modrdn = NULL;
-       bi->bi_op_add = NULL;
-       bi->bi_op_delete = NULL;
+       bi->bi_op_modrdn = 0;
+       bi->bi_op_add = 0;
+       bi->bi_op_delete = 0;
        bi->bi_op_abandon = monitor_back_abandon;
 
-       bi->bi_extended = NULL;
+       bi->bi_extended = 0;
 
-       bi->bi_entry_release_rw = NULL;
-       bi->bi_acl_group = NULL;
-       bi->bi_acl_attribute = NULL;
-       bi->bi_chk_referrals = NULL;
+       bi->bi_entry_release_rw = 0;
+       bi->bi_acl_group = 0;
+       bi->bi_acl_attribute = 0;
+       bi->bi_chk_referrals = 0;
        bi->bi_operational = monitor_back_operational;
 
        /*
         * hooks for slap tools
         */
-       bi->bi_tool_entry_open = NULL;
-       bi->bi_tool_entry_close = NULL;
-       bi->bi_tool_entry_first = NULL;
-       bi->bi_tool_entry_next = NULL;
-       bi->bi_tool_entry_get = NULL;
-       bi->bi_tool_entry_put = NULL;
-       bi->bi_tool_entry_reindex = NULL;
-       bi->bi_tool_sync = NULL;
+       bi->bi_tool_entry_open = 0;
+       bi->bi_tool_entry_close = 0;
+       bi->bi_tool_entry_first = 0;
+       bi->bi_tool_entry_next = 0;
+       bi->bi_tool_entry_get = 0;
+       bi->bi_tool_entry_put = 0;
+       bi->bi_tool_entry_reindex = 0;
+       bi->bi_tool_sync = 0;
 
        bi->bi_connection_init = 0;
        bi->bi_connection_destroy = 0;
index 39d528e776e109d43e3554aefd4709574c2cf91f..92fdc25677f250588616a2ef97d4257e9bc3779d 100644 (file)
@@ -961,7 +961,7 @@ int backend_check_referrals(
                const char *text;
 
                rc = be->be_chk_referrals( be,
-                       conn, op, dn->bv_val, ndn->bv_val, &text );
+                       conn, op, dn, ndn, &text );
 
                if( rc != LDAP_SUCCESS && rc != LDAP_REFERRAL ) {
                        send_ldap_result( conn, op, rc,
index bbcd93ab667be508f76d59fb5127875a981cd1b8..e03fbfcee89326c8566ea17bcbb99c41be31928b 100644 (file)
@@ -593,15 +593,15 @@ glue_back_referrals (
        BackendDB *b0,
        Connection *conn,
        Operation *op,
-       const char *dn,
-       const char *ndn,
+       struct berval *dn,
+       struct berval *ndn,
        const char **text
 )
 {
        BackendDB *be;
        int rc;
 
-       be = glue_back_select (b0, ndn);
+       be = glue_back_select (b0, ndn->bv_val);
 
        if (be && be->be_chk_referrals) {
                rc = be->be_chk_referrals (be, conn, op, dn, ndn, text);
index d3c19992c622fd273b91c223f70bb836e831ebd5..7748aaaaeeb3d9f3858fb623c6e87b912e83ee81 100644 (file)
@@ -188,6 +188,10 @@ SOURCE=.\config.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\configinfo.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\connection.c
 # End Source File
 # Begin Source File
index 5955aef7a0d4a182502dcd901c7756bb580e9ee1..51f5106bd1770d4086fdd6bc6d8d5e9dceafc35f 100644 (file)
@@ -1086,7 +1086,7 @@ typedef int (BI_entry_release_rw) LDAP_P((BackendDB *bd,
 
 typedef int (BI_chk_referrals) LDAP_P((BackendDB *bd,
                struct slap_conn *c, struct slap_op *o,
-               const char *dn, const char *ndn,
+               struct berval *dn, struct berval *ndn,
                const char **text ));
 
 typedef int (BI_acl_group)  LDAP_P((Backend *bd,