From: Kurt Zeilenga Date: Sat, 25 Nov 2006 06:08:29 +0000 (+0000) Subject: backport slap_add_opattrs() error checking X-Git-Tag: OPENLDAP_REL_ENG_2_3_31~35 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1de6a92cf6a84962727da23241c2c1f7df2dcd66;p=openldap backport slap_add_opattrs() error checking --- diff --git a/CHANGES b/CHANGES index 5713271d9c..6888e5cf2f 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ OpenLDAP 2.3 Change Log OpenLDAP 2.3.31 Engineering Fixed slapd group ACL caching when proxyAuthz'ing (ITS#4760) Fixed slapd "group" authz default member parsing (ITS#4761) + Fixed slapd-bdb/hdb/ldbm slap_add_opattrs error checking Documentation Fixed typo in slapo-retcode(5) man page (ITS#4753) @@ -19,7 +20,7 @@ OpenLDAP 2.3.29 Release Fixed libldap string length assert (ITS#4740) Fixed liblunicode case mapping (ITS#4724) Fixed slapd ldapi:// socket permissions (ITS#4709) - Fixed slapd c_writewaiters assert (ITS#4696, #4736) + Fixed slapd c_writewaiters assert (ITS#4696,4736) Fixed slapo-accesslog purge contextCSN bug (ITS#4704) Fixed slapo-accesslog modify/replace bug (ITS#4728) Fixed slapo-dynlist leaks (ITS#4664) diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 7642e235df..59decd1ee2 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -51,7 +51,13 @@ bdb_add(Operation *op, SlapReply *rs ) /* add opattrs to shadow as well, only missing attrs will actually * be added; helps compatibility with older OL versions */ - slap_add_opattrs( op, &rs->sr_text, textbuf, textlen, 1 ); + rs->sr_err = slap_add_opattrs( op, &rs->sr_text, textbuf, textlen, 1 ); + if ( rs->sr_err != LDAP_SUCCESS ) { + Debug( LDAP_DEBUG_TRACE, + LDAP_XSTRING(bdb_add) ": entry failed op attrs add: " + "%s (%d)\n", rs->sr_text, rs->sr_err, 0 ); + goto return_results; + } /* check entry's schema */ rs->sr_err = entry_schema_check( op, op->oq_add.rs_e, NULL, diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index d953e93df6..ae488d143c 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -56,7 +56,13 @@ ldbm_back_add( Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", op->o_req_dn.bv_val, 0, 0); - slap_add_opattrs( op, &rs->sr_text, textbuf, textlen, 1 ); + rs->sr_err = slap_add_opattrs( op, &rs->sr_text, textbuf, textlen, 1 ); + if ( rs->sr_err != LDAP_SUCCESS ) { + Debug( LDAP_DEBUG_TRACE, + "entry failed op attrs add: %s (%d)\n", + rs->sr_text, rs->sr_err, 0 ); + goto return_results; + } cb.sc_cleanup = ldbm_csn_cb; cb.sc_next = op->o_callback;