Skip to content

Commit

Permalink
Ticket 47817 - The error result text message should be obtained just …
Browse files Browse the repository at this point in the history
…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 68e7668)
  • Loading branch information
mreynolds389 committed Jun 18, 2014
1 parent 887a72e commit dd51540
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ldap/servers/slapd/back-ldbm/ldbm_add.c
Expand Up @@ -94,8 +94,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};
Expand Down Expand Up @@ -1225,6 +1225,8 @@ ldbm_back_add( Slapi_PBlock *pb )
/* tell frontend not to free this entry */
slapi_pblock_set(pb, SLAPI_ADD_ENTRY, NULL);
}

slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message);
}

/* Release SERIAL LOCK */
Expand Down
3 changes: 2 additions & 1 deletion ldap/servers/slapd/back-ldbm/ldbm_delete.c
Expand Up @@ -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;
Expand Down Expand Up @@ -1331,6 +1331,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
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);
}

/* Release SERIAL LOCK */
Expand Down
1 change: 1 addition & 0 deletions ldap/servers/slapd/back-ldbm/ldbm_modify.c
Expand Up @@ -901,6 +901,7 @@ ldbm_back_modify( Slapi_PBlock *pb )
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);
Expand Down
1 change: 1 addition & 0 deletions ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
Expand Up @@ -1397,6 +1397,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
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);
}

/* Release SERIAL LOCK */
Expand Down

0 comments on commit dd51540

Please sign in to comment.