} else if ( rs->sr_err == LDAP_SUCCESS ) {
struct timeval tv, *tvp = NULL;
LDAPMessage *res = NULL;
+ int rc;
if ( mi->mi_targets[ candidate ].mt_timeout[ META_OP_ADD ] != 0 ) {
tv.tv_sec = mi->mi_targets[ candidate ].mt_timeout[ META_OP_ADD ];
tvp = &tv;
}
- rs->sr_err = ldap_result( mc->mc_conns[ candidate ].msc_ld,
+ rs->sr_err = LDAP_OTHER;
+ rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
msgid, LDAP_MSG_ONE, tvp, &res );
- switch ( rs->sr_err ) {
+ switch ( rc ) {
case -1:
- rs->sr_err = LDAP_OTHER;
send_ldap_result( op, rs );
goto cleanup;
send_ldap_result( op, rs );
goto cleanup;
+ case LDAP_RES_ADD:
+ rc = ldap_parse_result( mc->mc_conns[ candidate ].msc_ld,
+ res, &rs->sr_err, NULL, NULL, NULL, NULL, 1 );
+ if ( rc != LDAP_SUCCESS ) {
+ rs->sr_err = rc;
+ }
+ break;
+
default:
ldap_msgfree( res );
break;
} else if ( rs->sr_err == LDAP_SUCCESS ) {
struct timeval tv, *tvp = NULL;
LDAPMessage *res = NULL;
+ int rc;
if ( mi->mi_targets[ candidate ].mt_timeout[ META_OP_DELETE ] != 0 ) {
tv.tv_sec = mi->mi_targets[ candidate ].mt_timeout[ META_OP_DELETE ];
tvp = &tv;
}
- rs->sr_err = ldap_result( mc->mc_conns[ candidate ].msc_ld,
+ rs->sr_err = LDAP_OTHER;
+ rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
msgid, LDAP_MSG_ONE, tvp, &res );
- switch ( rs->sr_err ) {
+ switch ( rc ) {
case -1:
rs->sr_err = LDAP_OTHER;
send_ldap_result( op, rs );
send_ldap_result( op, rs );
goto cleanup;
+ case LDAP_RES_DELETE:
+ rc = ldap_parse_result( mc->mc_conns[ candidate ].msc_ld,
+ res, &rs->sr_err, NULL, NULL, NULL, NULL, 1 );
+ if ( rc != LDAP_SUCCESS ) {
+ rs->sr_err = rc;
+ }
+ break;
+
default:
ldap_msgfree( res );
break;
tvp = &tv;
}
- rs->sr_err = ldap_result( mc->mc_conns[ candidate ].msc_ld,
+ rs->sr_err = LDAP_OTHER;
+ rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
msgid, LDAP_MSG_ONE, tvp, &res );
- switch ( rs->sr_err ) {
+ switch ( rc ) {
case -1:
- rs->sr_err = LDAP_OTHER;
rc = -1;
break;
rc = -1;
break;
+ case LDAP_RES_MODIFY:
+ rc = ldap_parse_result( mc->mc_conns[ candidate ].msc_ld,
+ res, &rs->sr_err, NULL, NULL, NULL, NULL, 1 );
+ if ( rc != LDAP_SUCCESS ) {
+ rs->sr_err = rc;
+ }
+ rc = 0;
+ break;
+
default:
+ rc = -1;
ldap_msgfree( res );
break;
}
} else if ( rs->sr_err == LDAP_SUCCESS ) {
struct timeval tv, *tvp = NULL;
LDAPMessage *res = NULL;
+ int rc;
if ( mi->mi_targets[ candidate ].mt_timeout[ META_OP_MODRDN ] != 0 ) {
tv.tv_sec = mi->mi_targets[ candidate ].mt_timeout[ META_OP_MODRDN ];
tvp = &tv;
}
- rs->sr_err = ldap_result( mc->mc_conns[ candidate ].msc_ld,
+ rs->sr_err = LDAP_OTHER;
+ rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
msgid, LDAP_MSG_ONE, tvp, &res );
- switch ( rs->sr_err ) {
+ switch ( rc ) {
case -1:
- rs->sr_err = LDAP_OTHER;
break;
case 0:
LDAP_ADMINLIMIT_EXCEEDED : LDAP_OPERATIONS_ERROR;
break;
+ case LDAP_RES_RENAME:
+ rc = ldap_parse_result( mc->mc_conns[ candidate ].msc_ld,
+ res, &rs->sr_err, NULL, NULL, NULL, NULL, 1 );
+ if ( rc != LDAP_SUCCESS ) {
+ rs->sr_err = rc;
+ }
+ break;
+
default:
ldap_msgfree( res );
break;
if ( rs->sr_err == LDAP_SUCCESS ) {
meta_back_op_result( mc, op, rs, candidate );
+ } else {
+ send_ldap_result( op, rs );
}
- send_ldap_result( op, rs );
-
meta_back_release_conn( op, mc );
return rs->sr_err;