From: Kurt Zeilenga Date: Sun, 28 May 2000 22:38:21 +0000 (+0000) Subject: Fix error text handling X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2819 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=13daacdbda33b92f5d88cd9a0d18965790787860;p=openldap Fix error text handling --- diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index 141bdb45b5..8ee12c53c3 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -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 diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index fadc60fd12..02c039ea6e 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -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 ); diff --git a/servers/slapd/back-ldbm/modrdn.c b/servers/slapd/back-ldbm/modrdn.c index 40a33545d4..c2185bb0bf 100644 --- a/servers/slapd/back-ldbm/modrdn.c +++ b/servers/slapd/back-ldbm/modrdn.c @@ -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 */ diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 8a09394b3b..bf0da226bb 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -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;