Commit 0d0ae8a8 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

ITS#4450 fix from head

parent 046f0efa
...@@ -112,6 +112,7 @@ ldap_back_exop_passwd( ...@@ -112,6 +112,7 @@ ldap_back_exop_passwd(
ber_int_t msgid; ber_int_t msgid;
int rc, isproxy; int rc, isproxy;
int do_retry = 1; int do_retry = 1;
char *text = NULL;
lc = ldap_back_getconn( op, rs, LDAP_BACK_SENDERR ); lc = ldap_back_getconn( op, rs, LDAP_BACK_SENDERR );
if ( !lc || !ldap_back_dobind( lc, op, rs, LDAP_BACK_SENDERR ) ) { if ( !lc || !ldap_back_dobind( lc, op, rs, LDAP_BACK_SENDERR ) ) {
...@@ -140,7 +141,7 @@ retry: ...@@ -140,7 +141,7 @@ retry:
*/ */
rc = ldap_parse_result( lc->lc_ld, res, &rs->sr_err, rc = ldap_parse_result( lc->lc_ld, res, &rs->sr_err,
(char **)&rs->sr_matched, (char **)&rs->sr_matched,
(char **)&rs->sr_text, &text,
NULL, NULL, 0 ); NULL, NULL, 0 );
if ( rc == LDAP_SUCCESS ) { if ( rc == LDAP_SUCCESS ) {
...@@ -180,6 +181,7 @@ retry: ...@@ -180,6 +181,7 @@ retry:
goto retry; goto retry;
} }
} }
if ( text ) rs->sr_text = text;
send_ldap_extended( op, rs ); send_ldap_extended( op, rs );
/* otherwise frontend resends result */ /* otherwise frontend resends result */
rc = rs->sr_err = SLAPD_ABANDON; rc = rs->sr_err = SLAPD_ABANDON;
...@@ -191,8 +193,8 @@ retry: ...@@ -191,8 +193,8 @@ retry:
rs->sr_matched = NULL; rs->sr_matched = NULL;
} }
if ( rs->sr_text ) { if ( text ) {
free( (char *)rs->sr_text ); free( text );
rs->sr_text = NULL; rs->sr_text = NULL;
} }
...@@ -213,6 +215,7 @@ ldap_back_exop_generic( ...@@ -213,6 +215,7 @@ ldap_back_exop_generic(
ber_int_t msgid; ber_int_t msgid;
int rc; int rc;
int do_retry = 1; int do_retry = 1;
char *text = NULL;
lc = ldap_back_getconn( op, rs, LDAP_BACK_SENDERR ); lc = ldap_back_getconn( op, rs, LDAP_BACK_SENDERR );
if ( !lc || !ldap_back_dobind( lc, op, rs, LDAP_BACK_SENDERR ) ) { if ( !lc || !ldap_back_dobind( lc, op, rs, LDAP_BACK_SENDERR ) ) {
...@@ -238,7 +241,7 @@ retry: ...@@ -238,7 +241,7 @@ retry:
*/ */
rc = ldap_parse_result( lc->lc_ld, res, &rs->sr_err, rc = ldap_parse_result( lc->lc_ld, res, &rs->sr_err,
(char **)&rs->sr_matched, (char **)&rs->sr_matched,
(char **)&rs->sr_text, text,
NULL, NULL, 0 ); NULL, NULL, 0 );
if ( rc == LDAP_SUCCESS ) { if ( rc == LDAP_SUCCESS ) {
if ( rs->sr_err == LDAP_SUCCESS ) { if ( rs->sr_err == LDAP_SUCCESS ) {
...@@ -264,6 +267,7 @@ retry: ...@@ -264,6 +267,7 @@ retry:
goto retry; goto retry;
} }
} }
if ( text ) rs->sr_text = text;
send_ldap_extended( op, rs ); send_ldap_extended( op, rs );
/* otherwise frontend resends result */ /* otherwise frontend resends result */
rc = rs->sr_err = SLAPD_ABANDON; rc = rs->sr_err = SLAPD_ABANDON;
...@@ -275,8 +279,8 @@ retry: ...@@ -275,8 +279,8 @@ retry:
rs->sr_matched = NULL; rs->sr_matched = NULL;
} }
if ( rs->sr_text ) { if ( text ) {
free( (char *)rs->sr_text ); free( text );
rs->sr_text = NULL; rs->sr_text = NULL;
} }
......
...@@ -375,16 +375,19 @@ retry: ...@@ -375,16 +375,19 @@ retry:
} }
} else { } else {
char **references = NULL; char **references = NULL, *err = NULL;
rc = ldap_parse_result( lc->lc_ld, res, &rs->sr_err, rc = ldap_parse_result( lc->lc_ld, res, &rs->sr_err,
&match.bv_val, (char **)&rs->sr_text, &match.bv_val, &err,
&references, &rs->sr_ctrls, 1 ); &references, &rs->sr_ctrls, 1 );
freetext = 1;
if ( rc != LDAP_SUCCESS ) { if ( rc != LDAP_SUCCESS ) {
rs->sr_err = rc; rs->sr_err = rc;
} }
rs->sr_err = slap_map_api2result( rs ); rs->sr_err = slap_map_api2result( rs );
if ( err ) {
rs->sr_text = err;
freetext = 1;
}
if ( references && references[ 0 ] && references[ 0 ][ 0 ] ) { if ( references && references[ 0 ] && references[ 0 ][ 0 ] ) {
int cnt; int cnt;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment