Wednesday, June 18, 2014

[389-commits] Branch '389-ds-base-1.2.11' - ldap/servers

ldap/servers/slapd/back-ldbm/ldbm_add.c | 5 +++--
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 3 ++-
ldap/servers/slapd/back-ldbm/ldbm_modify.c | 1 +
ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 1 +
4 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 6f6142ed787507190a0181658c6063bf84a0d924
Author: Mark Reynolds <mreynolds@redhat.com>
Date: Tue Jun 17 17:58:54 2014 -0400

Ticket 47817 - The error result text message should be obtained just prior to sending result

Bug Description: We do not get pblock result message after the betxn postop plugins
are called. If a betxn plugin modified the ldap result message, then
when the backend returns the results it does an invalid read on the
old pointer of the old result message.

Fix Description: Get the result message after we call the betxn postop plugins.

https://fedorahosted.org/389/ticket/47817

jenkins: passed

Reviewed by: nhosoi(Thanks!)

(cherry picked from commit 68e766891d1067b2b86bd48bfa16d0837fa5a737)

Conflicts:
ldap/servers/slapd/back-ldbm/ldbm_add.c

diff --git a/ldap/servers/slapd/back-ldbm/ldbm_add.c b/ldap/servers/slapd/back-ldbm/ldbm_add.c
index b129307..9e176fa 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_add.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_add.c
@@ -93,8 +93,8 @@ ldbm_back_add( Slapi_PBlock *pb )
char *msg;
int managedsait;
int ldap_result_code = LDAP_SUCCESS;
- char *ldap_result_message= NULL;
- char *ldap_result_matcheddn= NULL;
+ char *ldap_result_message = NULL;
+ char *ldap_result_matcheddn = NULL;
int retry_count = 0;
int disk_full = 0;
modify_context parent_modify_c = {0};
@@ -1181,6 +1181,7 @@ diskfull_return:
opreturn = -1;
slapi_pblock_set(pb, SLAPI_PLUGIN_OPRETURN, &opreturn);
}
+ slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message);
}

if (!noabort) {
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index 32feeb1..6e69d24 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -75,7 +75,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
modify_context ruv_c = {0};
int rc = 0;
int ldap_result_code= LDAP_SUCCESS;
- char *ldap_result_message= NULL;
+ char *ldap_result_message = NULL;
Slapi_DN *sdnp = NULL;
char *e_uniqueid = NULL;
Slapi_DN nscpEntrySDN;
@@ -1274,6 +1274,7 @@ error_return:
if (!opreturn) {
slapi_pblock_set( pb, SLAPI_PLUGIN_OPRETURN, ldap_result_code ? &ldap_result_code : &retval );
}
+ slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message);
}

dblayer_txn_abort(li,&txn); /* abort crashes in case disk full */
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
index b6a889f..a40b5c4 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modify.c
@@ -826,6 +826,7 @@ error_return:
LDAPDebug1Arg( LDAP_DEBUG_TRACE, "SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN plugin "
"returned error code %d\n", retval );
slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message);
slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &opreturn);
if (!opreturn) {
slapi_pblock_set(pb, SLAPI_PLUGIN_OPRETURN, ldap_result_code ? &ldap_result_code : &retval);
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
index 09d8f05..3e5f686 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
@@ -1367,6 +1367,7 @@ error_return:
if (!opreturn) {
slapi_pblock_set( pb, SLAPI_PLUGIN_OPRETURN, ldap_result_code ? &ldap_result_code : &retval );
}
+ slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message);
}

dblayer_txn_abort(li,&txn); /* abort crashes in case disk full */


--
389 commits mailing list
389-commits@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-commits

No comments:

Post a Comment