From: Pierangelo Masarati Date: Thu, 2 Dec 2004 12:17:33 +0000 (+0000) Subject: find as early as possible that attribute delete cannot be performed; also fixes ITS... X-Git-Tag: OPENLDAP_REL_ENG_2_2_20~26 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6a1680157c3cd1a6c22673f3c13297d2295f4b28;p=openldap find as early as possible that attribute delete cannot be performed; also fixes ITS#3407 (import from HEAD) --- diff --git a/CHANGES b/CHANGES index 2b42da81b2..10ff50d445 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ OpenLDAP 2.2 Change Log OpenLDAP 2.2.20 Engineering - + Fixed back-sql segfault when logging and delete_rule is NULL (ITS#3407) OpenLDAP 2.2.19 Release Fixed slapd check for mandatory filter in authz-regexp URI (ITS#3396) diff --git a/servers/slapd/back-sql/add.c b/servers/slapd/back-sql/add.c index 96bd88c191..76ff17cfce 100644 --- a/servers/slapd/back-sql/add.c +++ b/servers/slapd/back-sql/add.c @@ -58,13 +58,29 @@ backsql_modify_delete_all_values( SQLHSTMT asth; BACKSQL_ROW_NTS row; + assert( at ); + if ( at->bam_delete_proc == NULL ) { + Debug( LDAP_DEBUG_TRACE, + " backsql_modify_delete_all_values(): " + "missing attribute value delete procedure " + "for attr \"%s\"\n", + at->bam_ad->ad_cname.bv_val, 0, 0 ); + if ( BACKSQL_FAIL_IF_NO_MAPPING( bi ) ) { + rs->sr_text = "SQL-backend error"; + return rs->sr_err = LDAP_OTHER; + } + + return LDAP_SUCCESS; + } + rc = backsql_Prepare( dbh, &asth, at->bam_query, 0 ); if ( rc != SQL_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, " backsql_modify_delete_all_values(): " - "error preparing query\n", 0, 0, 0 ); - backsql_PrintErrors( bi->db_env, dbh, - asth, rc ); + "error preparing attribute value select query " + "\"%s\"\n", + at->bam_query, 0, 0 ); + backsql_PrintErrors( bi->db_env, dbh, asth, rc ); if ( BACKSQL_FAIL_IF_NO_MAPPING( bi ) ) { rs->sr_text = "SQL-backend error";