]> git.sur5r.net Git - openldap/commitdiff
Fix error text handling
authorKurt Zeilenga <kurt@openldap.org>
Sun, 28 May 2000 22:38:21 +0000 (22:38 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 28 May 2000 22:38:21 +0000 (22:38 +0000)
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/modrdn.c
servers/slapd/back-ldbm/search.c

index 141bdb45b5cecd7e56bcddafdf40b2571e19da24..8ee12c53c39d70339a14e22d14d0c259eda9d14b 100644 (file)
@@ -29,7 +29,7 @@ ldbm_back_add(
        Entry           *p = NULL;
        int                     rootlock = 0;
        int                     rc; 
-       const char      *text;
+       const char      *text = NULL;
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
        AttributeDescription *children = slap_schema.si_ad_children;
 #else
index fadc60fd12c0b25018ef9048f341c52c233e6860..02c039ea6e9c3b025338f0f050da2092bcccbb00 100644 (file)
@@ -42,6 +42,8 @@ int ldbm_modify_internal(
        Modifications   *ml;
        Attribute       *save_attrs;
 
+       Debug(LDAP_DEBUG_TRACE, "ldbm_modify_internal:\n", 0, 0, 0);
+
        if ( !acl_check_modlist( be, conn, op, e, modlist )) {
                return LDAP_INSUFFICIENT_ACCESS;
        }
@@ -54,6 +56,7 @@ int ldbm_modify_internal(
 
                switch ( mod->sm_op ) {
                case LDAP_MOD_ADD:
+                       Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: add\n", 0, 0, 0);
                        err = add_values( e, mod, op->o_ndn );
 
                        if( err != LDAP_SUCCESS ) {
@@ -62,6 +65,7 @@ int ldbm_modify_internal(
                        break;
 
                case LDAP_MOD_DELETE:
+                       Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: delete\n", 0, 0, 0);
                        err = delete_values( e, mod, op->o_ndn );
                        assert( err != LDAP_TYPE_OR_VALUE_EXISTS );
                        if( err != LDAP_SUCCESS ) {
@@ -70,6 +74,7 @@ int ldbm_modify_internal(
                        break;
 
                case LDAP_MOD_REPLACE:
+                       Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: replace\n", 0, 0, 0);
                        err = replace_values( e, mod, op->o_ndn );
                        assert( err != LDAP_TYPE_OR_VALUE_EXISTS );
                        if( err != LDAP_SUCCESS ) {
@@ -78,6 +83,7 @@ int ldbm_modify_internal(
                        break;
 
                case SLAP_MOD_SOFTADD:
+                       Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: softadd\n", 0, 0, 0);
                        /* Avoid problems in index_add_mods()
                         * We need to add index if necessary.
                         */
@@ -94,6 +100,9 @@ int ldbm_modify_internal(
                        break;
 
                default:
+                       Debug(LDAP_DEBUG_ANY, "ldbm_modify_internal: invalid op %d\n",
+                               mod->sm_op, 0, 0);
+                       *text = "Invalid modify operation";
                        err = LDAP_OTHER;
                }
 
@@ -234,7 +243,7 @@ ldbm_back_modify(
        Entry           *matched;
        Entry           *e;
        int             manageDSAit = get_manageDSAit( op );
-       const char *text;
+       const char *text = NULL;
 
        Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0);
 
@@ -296,7 +305,7 @@ ldbm_back_modify(
        /* change the entry itself */
        if ( id2entry_add( be, e ) != 0 ) {
                send_ldap_result( conn, op, LDAP_OTHER,
-                       NULL, NULL, NULL, NULL );
+                       NULL, "id2entry failure", NULL, NULL );
                goto error_return;
        }
 
@@ -388,7 +397,7 @@ delete_values(
                for ( j = 0; a->a_vals[j] != NULL; j++ ) {
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
                        int match;
-                       const char *text;
+                       const char *text = NULL;
                        int rc = value_match( &match, mod->sm_desc,
                                mod->sm_desc->ad_type->sat_equality,
                                mod->sm_bvalues[i], a->a_vals[j], &text );
index 40a33545d481203a4a15f0a550a8542d37681947..c2185bb0bf2f5e602d8bbc538b3aca4920161ad6 100644 (file)
@@ -56,7 +56,7 @@ ldbm_back_modrdn(
        Entry           *matched;
        int                     rootlock = 0;
        int                     rc = -1;
-       const char *text;
+       const char *text = NULL;
        /* Added to support LDAP v2 correctly (deleteoldrdn thing) */
        char            *new_rdn_val = NULL;    /* Val of new rdn */
        char            *new_rdn_type = NULL;   /* Type of new rdn */
index 8a09394b3b39e6a7c26807b38976f5c35e187bb9..bf0da226bbfd212010861898e82ef63c8e611859 100644 (file)
@@ -43,7 +43,7 @@ ldbm_back_search(
 {
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
        int             rc, err;
-       const char *text;
+       const char *text = NULL;
        time_t          stoptime;
        ID_BLOCK                *candidates;
        ID              id, cursor;