]> git.sur5r.net Git - openldap/commitdiff
More struct berval DNs changes
authorKurt Zeilenga <kurt@openldap.org>
Wed, 26 Dec 2001 23:43:28 +0000 (23:43 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 26 Dec 2001 23:43:28 +0000 (23:43 +0000)
include/portable.nt
libraries/libldap/cyrus.c
servers/slapd/back-bdb/attribute.c
servers/slapd/back-ldbm/attribute.c
servers/slapd/back-ldbm/group.c
servers/slapd/backend.c
servers/slapd/backglue.c
servers/slapd/slap.h

index 7e831ec2b85e251c0350b4eff015fe1b86cfd7fc..fdfff9712bdaa4197ad4490af4dd7f7bdfab5a14 100644 (file)
 /* #undef SLAPD_META_DYNAMIC */
 
 /* define to support cn=Monitor backend */
-/* #undef SLAPD_MONITOR */
+#define SLAPD_MONITOR 1
 
 /* define to support dynamic cn=Monitor backend */
 /* #undef SLAPD_MONITOR_DYNAMIC */
index bc8288d90e2a255ec4680138eb4716d87c0d4de1..390ae47400a0580eb973c51d392ef4af34447f58 100644 (file)
@@ -214,7 +214,7 @@ sb_sasl_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
                sbiod->sbiod_sb->sb_debug );
 
        /* Grow the packet buffer if neccessary */
-       if ( ( p->sec_buf_in.buf_size < ret ) && 
+       if ( ( p->sec_buf_in.buf_size < (ber_len_t) ret ) && 
                ber_pvt_sb_grow_buffer( &p->sec_buf_in, ret ) < 0 )
        {
                errno = ENOMEM;
index 0bce1e0d5d9a34310c8f1eddd1ae070514cd045f..3c976a26cd6002c45ff539a5748fb662d0476d2d 100644 (file)
@@ -26,7 +26,7 @@ bdb_attribute(
        Connection *conn,
        Operation *op,
        Entry *target,
-       const char *entry_ndn,
+       struct berval *entry_ndn,
        AttributeDescription *entry_at,
        struct berval ***vals )
 {
@@ -39,7 +39,7 @@ bdb_attribute(
 
 #ifdef NEW_LOGGING
        LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
-               "bdb_attribute: gr dn: \"%s\"\n", entry_ndn ));
+               "bdb_attribute: gr dn: \"%s\"\n", entry_ndn->bv_val ));
        LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
                "bdb_attribute: at: \"%s\"\n", entry_at_name));
        LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
@@ -48,7 +48,7 @@ bdb_attribute(
 #else
        Debug( LDAP_DEBUG_ARGS,
                "=> bdb_attribute: gr dn: \"%s\"\n",
-               entry_ndn, 0, 0 ); 
+               entry_ndn->bv_val, 0, 0 ); 
        Debug( LDAP_DEBUG_ARGS,
                "=> bdb_attribute: at: \"%s\"\n", 
                entry_at_name, 0, 0 ); 
@@ -58,17 +58,17 @@ bdb_attribute(
                target ? target->e_ndn : "", 0, 0 ); 
 #endif
 
-       if (target != NULL && strcmp(target->e_ndn, entry_ndn) == 0) {
+       if (target != NULL && strcmp(target->e_ndn, entry_ndn->bv_val) == 0) {
                /* we already have a LOCKED copy of the entry */
                e = target;
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
                        "bdb_attribute: target is LOCKED (%s)\n",
-                       entry_ndn ));
+                       entry_ndn->bv_val ));
 #else
                Debug( LDAP_DEBUG_ARGS,
                        "=> bdb_attribute: target is entry: \"%s\"\n",
-                       entry_ndn, 0, 0 );
+                       entry_ndn->bv_val, 0, 0 );
 #endif
 
 
@@ -86,22 +86,23 @@ bdb_attribute(
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
                                "bdb_attribute: cannot find entry (%s)\n",
-                               entry_ndn ));
+                               entry_ndn->bv_val ));
 #else
                        Debug( LDAP_DEBUG_ACL,
                                "=> bdb_attribute: cannot find entry: \"%s\"\n",
-                                       entry_ndn, 0, 0 ); 
+                                       entry_ndn->bv_val, 0, 0 ); 
 #endif
                        return LDAP_NO_SUCH_OBJECT; 
                }
                
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "bdb_attribute: found entry (%s)\n", e_ndn ));
+                       "bdb_attribute: found entry (%s)\n",
+                       entry_ndn->bv_val ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> bdb_attribute: found entry: \"%s\"\n",
-                       entry_ndn, 0, 0 ); 
+                       entry_ndn->bv_val, 0, 0 ); 
 #endif
        }
 
index e07d1ea27baac98af49eec2c6044cb55178b0cd5..0e1e4303cd9d7a623cf9db9d2e30ca1f2e6dcb57 100644 (file)
@@ -26,7 +26,7 @@ ldbm_back_attribute(
        Connection *conn,
        Operation *op,
        Entry   *target,
-       const char      *entry_ndn,
+       struct berval   *entry_ndn,
        AttributeDescription *entry_at,
        struct berval ***vals )
 {
@@ -58,23 +58,23 @@ ldbm_back_attribute(
                target ? target->e_ndn : "", 0, 0 ); 
 #endif
 
-       if (target != NULL && strcmp(target->e_ndn, entry_ndn) == 0) {
+       if (target != NULL && strcmp(target->e_ndn, entry_ndn->bv_val) == 0) {
                /* we already have a LOCKED copy of the entry */
                e = target;
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
                        "ldbm_back_attribute: target is LOCKED (%s)\n",
-                       entry_ndn ));
+                       entry_ndn->bv_val ));
 #else
                Debug( LDAP_DEBUG_ARGS,
                        "=> ldbm_back_attribute: target is entry: \"%s\"\n",
-                       entry_ndn, 0, 0 );
+                       entry_ndn->bv_val, 0, 0 );
 #endif
 
 
        } else {
                /* can we find entry with reader lock */
-               if ((e = dn2entry_r(be, entry_ndn, NULL )) == NULL) {
+               if ((e = dn2entry_r(be, entry_ndn->bv_val, NULL )) == NULL) {
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
                                "ldbm_back_attribute: cannot find entry (%s)\n",
@@ -90,11 +90,12 @@ ldbm_back_attribute(
                
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                       "ldbm_back_attribute: found entry (%s)\n", entry_ndn ));
+                       "ldbm_back_attribute: found entry (%s)\n",
+                       entry_ndn->bv_val ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> ldbm_back_attribute: found entry: \"%s\"\n",
-                       entry_ndn, 0, 0 ); 
+                       entry_ndn->bv_val, 0, 0 ); 
 #endif
 
     }
@@ -104,7 +105,7 @@ ldbm_back_attribute(
        if( is_entry_alias( e ) ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_attribute: entry (%s) is an alias\n", e->e_dn ));
+                       "ldbm_back_attribute: entry (%s) is an alias\n", e->e_dn ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_attribute: entry is an alias\n", 0, 0, 0 );
@@ -117,7 +118,7 @@ ldbm_back_attribute(
        if( is_entry_referral( e ) ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_attribute: entry (%s) is a referral.\n", e->e_dn ));
+                       "ldbm_back_attribute: entry (%s) is a referral.\n", e->e_dn ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_attribute: entry is an referral\n", 0, 0, 0 );
@@ -138,7 +139,7 @@ ldbm_back_attribute(
        if ((attr = attr_find(e->e_attrs, entry_at)) == NULL) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_attribute: failed to find %s.\n", entry_at_name ));
+                       "ldbm_back_attribute: failed to find %s.\n", entry_at_name ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_attribute: failed to find %s\n",
index 476ce38a59e70a8b1339261deb5608834dda5865..16440c9444bf2942837c83dd665ba39146a566e6 100644 (file)
@@ -27,8 +27,8 @@ ldbm_back_group(
        Connection *conn,
        Operation *op,
        Entry   *target,
-       const char      *gr_ndn,
-       const char      *op_ndn,
+       struct berval   *gr_ndn,
+       struct berval   *op_ndn,
        ObjectClass *group_oc,
        AttributeDescription *group_at
 )
@@ -37,7 +37,6 @@ ldbm_back_group(
        Entry        *e;
        int          rc = 1;
        Attribute   *attr;
-       struct berval bv;
 
        const char *group_oc_name = NULL;
        const char *group_at_name = group_at->ad_cname.bv_val;
@@ -50,16 +49,16 @@ ldbm_back_group(
 
 #ifdef NEW_LOGGING
        LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "ldbm_back_group: check (%s) member of (%s), oc %s\n",
-                  op_ndn, gr_ndn, group_oc_name ));
+               "ldbm_back_group: check (%s) member of (%s), oc %s\n",
+               op_ndn->bv_val, gr_ndn->bv_val, group_oc_name ));
 #else
        Debug( LDAP_DEBUG_ARGS,
                "=> ldbm_back_group: gr dn: \"%s\"\n",
-               gr_ndn, 0, 0 ); 
+               gr_ndn->bv_val, 0, 0 ); 
 
        Debug( LDAP_DEBUG_ARGS,
                "=> ldbm_back_group: op dn: \"%s\"\n",
-               op_ndn, 0, 0 ); 
+               op_ndn->bv_val, 0, 0 ); 
        Debug( LDAP_DEBUG_ARGS,
                "=> ldbm_back_group: oc: \"%s\" at: \"%s\"\n", 
                group_oc_name, group_at_name, 0 ); 
@@ -69,30 +68,31 @@ ldbm_back_group(
                target->e_ndn, 0, 0 ); 
 #endif
 
-       if (strcmp(target->e_ndn, gr_ndn) == 0) {
+       if (strcmp(target->e_ndn, gr_ndn->bv_val) == 0) {
                /* we already have a LOCKED copy of the entry */
                e = target;
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                          "ldbm_back_group: target is group (%s)\n", gr_ndn ));
+                       "ldbm_back_group: target is group (%s)\n",
+                       gr_ndn->bv_val ));
 #else
                Debug( LDAP_DEBUG_ARGS,
                        "=> ldbm_back_group: target is group: \"%s\"\n",
-                       gr_ndn, 0, 0 );
+                       gr_ndn->bv_val, 0, 0 );
 #endif
 
 
        } else {
                /* can we find group entry with reader lock */
-               if ((e = dn2entry_r(be, gr_ndn, NULL )) == NULL) {
+               if ((e = dn2entry_r(be, gr_ndn->bv_val, NULL )) == NULL) {
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                                  "ldbm_back_group: cannot find group (%s)\n",
-                                  gr_ndn ));
+                               "ldbm_back_group: cannot find group (%s)\n",
+                               gr_ndn->bv_val ));
 #else
                        Debug( LDAP_DEBUG_ACL,
                                "=> ldbm_back_group: cannot find group: \"%s\"\n",
-                                       gr_ndn, 0, 0 ); 
+                               gr_ndn->bv_val, 0, 0 ); 
 #endif
 
                        return( 1 );
@@ -100,11 +100,11 @@ ldbm_back_group(
                
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                          "ldbm_back_group: found group (%s)\n", gr_ndn ));
+                       "ldbm_back_group: found group (%s)\n", gr_ndn->bv_val ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "=> ldbm_back_group: found group: \"%s\"\n",
-                       gr_ndn, 0, 0 ); 
+                       gr_ndn->bv_val, 0, 0 ); 
 #endif
 
     }
@@ -120,7 +120,8 @@ ldbm_back_group(
        if( is_entry_alias( e ) ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_group: group (%s) is an alias\n", gr_ndn ));
+                       "ldbm_back_group: group (%s) is an alias\n",
+                       gr_ndn->bv_val ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_group: group is an alias\n", 0, 0, 0 );
@@ -132,7 +133,8 @@ ldbm_back_group(
        if( is_entry_referral( e ) ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_group: group (%s) is a referral.\n", gr_ndn ));
+                       "ldbm_back_group: group (%s) is a referral.\n",
+                       gr_ndn->bv_val ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_group: group is an referral\n", 0, 0, 0 );
@@ -144,8 +146,8 @@ ldbm_back_group(
        if( !is_entry_objectclass( e, group_oc ) ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "ldbm_back_group: failed to find %s in objectClass.\n",
-                          group_oc_name ));
+                       "ldbm_back_group: failed to find %s in objectClass.\n",
+                       group_oc_name ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_group: failed to find %s in objectClass\n", 
@@ -158,7 +160,7 @@ ldbm_back_group(
        if ((attr = attr_find(e->e_attrs, group_at)) == NULL) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
-                          "ldbm_back_group: failed to find %s\n", group_at_name ));
+                       "ldbm_back_group: failed to find %s\n", group_at_name ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_group: failed to find %s\n",
@@ -179,33 +181,29 @@ ldbm_back_group(
 #endif
 
 
-       bv.bv_val = (char *) op_ndn;
-       bv.bv_len = strlen( op_ndn );         
-
-       if( value_find( group_at, attr->a_vals, &bv ) != LDAP_SUCCESS ) {
+       if( value_find( group_at, attr->a_vals, op_ndn ) != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                          "ldbm_back_group: \"%s\" not in \"%s\": %s\n",
-                          op_ndn, gr_ndn, group_at_name ));
+                       "ldbm_back_group: \"%s\" not in \"%s\": %s\n",
+                       op_ndn->bv_val, gr_ndn->bv_val, group_at_name ));
 #else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_group: \"%s\" not in \"%s\": %s\n", 
-                       op_ndn, gr_ndn, group_at_name ); 
+                       op_ndn->bv_val, gr_ndn->bv_val, group_at_name ); 
 #endif
 
                goto return_results;
        }
 
 
-
 #ifdef NEW_LOGGING
        LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
-                  "ldbm_back_group: %s is in %s: %s\n",
-                  op_ndn, gr_ndn, group_at_name ));
+               "ldbm_back_group: %s is in %s: %s\n",
+               op_ndn->bv_val, gr_ndn->bv_val, group_at_name ));
 #else
        Debug( LDAP_DEBUG_ACL,
                "<= ldbm_back_group: \"%s\" is in \"%s\": %s\n", 
-               op_ndn, gr_ndn, group_at_name ); 
+               op_ndn->bv_val, gr_ndn->bv_val, group_at_name ); 
 #endif
 
 
@@ -219,7 +217,7 @@ return_results:
 
 #ifdef NEW_LOGGING
        LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "ldbm_back_group: rc=%d\n", rc ));
+               "ldbm_back_group: rc=%d\n", rc ));
 #else
        Debug( LDAP_DEBUG_TRACE, "ldbm_back_group: rc=%d\n", rc, 0, 0 ); 
 #endif
index 92fdc25677f250588616a2ef97d4257e9bc3779d..3d521248240079b75a836446fd1af20514939a92 100644 (file)
@@ -1018,7 +1018,7 @@ backend_group(
 
        if( be->be_group ) {
                int res = be->be_group( be, conn, op,
-                       target, gr_ndn->bv_val, op_ndn->bv_val,
+                       target, gr_ndn, op_ndn,
                        group_oc, group_at );
                
                if (op->o_tag != LDAP_REQ_BIND) {
@@ -1066,7 +1066,7 @@ backend_attribute(
        } 
 
        if( be->be_attribute ) {
-               return be->be_attribute( be, conn, op, target, edn->bv_val,
+               return be->be_attribute( be, conn, op, target, edn,
                        entry_at, vals );
        }
 
index a6fbdc6e7910bdcc11674387baf1a357956593e8..222319122c176a0d90be300d575c28122cef8a51 100644 (file)
@@ -548,8 +548,8 @@ glue_back_group (
        Connection *conn,
        Operation *op,
        Entry *target,
-       const char *ndn,
-       const char *ondn,
+       struct berval *ndn,
+       struct berval *ondn,
        ObjectClass *oc,
        AttributeDescription * ad
 )
@@ -557,7 +557,7 @@ glue_back_group (
        BackendDB *be;
        int rc;
 
-       be = glue_back_select (b0, ndn);
+       be = glue_back_select (b0, ndn->bv_val);
 
        if (be && be->be_group) {
                rc = be->be_group (be, conn, op, target, ndn, ondn, oc, ad);
@@ -573,7 +573,7 @@ glue_back_attribute (
        Connection *conn,
        Operation *op,
        Entry *target,
-       const char *ndn,
+       struct berval *ndn,
        AttributeDescription *ad,
        struct berval ***vals
 )
@@ -581,7 +581,7 @@ glue_back_attribute (
        BackendDB *be;
        int rc;
 
-       be = glue_back_select (b0, ndn);
+       be = glue_back_select (b0, ndn->bv_val);
 
        if (be && be->be_attribute) {
                rc = be->be_attribute (be, conn, op, target, ndn, ad, vals);
index 542eca40940433b9e5299eef4e51865fe71aecfd..908310b815c362442711dd2b4cb77dd5011ca37e 100644 (file)
@@ -1095,13 +1095,15 @@ typedef int (BI_chk_referrals) LDAP_P((BackendDB *bd,
 
 typedef int (BI_acl_group)  LDAP_P((Backend *bd,
                struct slap_conn *c, struct slap_op *o,
-               Entry *e, const char *bdn, const char *edn,
+               Entry *e,
+               struct berval *bdn,
+               struct berval *edn,
                ObjectClass *group_oc,
                AttributeDescription *group_at ));
 
 typedef int (BI_acl_attribute)  LDAP_P((Backend *bd,
                struct slap_conn *c, struct slap_op *o,
-               Entry *e, const char *edn,
+               Entry *e, struct berval *edn,
                AttributeDescription *entry_at,
                struct berval ***vals ));