Commit bb17e813 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#5834

parent aa3aabc6
......@@ -8,6 +8,7 @@ OpenLDAP 2.4.14 Engineering
Fixed libldap_r slapd lockup when paused during shutdown (ITS#5841)
Added slapd syncrepl default retry setting (ITS#5825)
Added slapd val.regex expansion (ITS#5804)
Added slapo-rwm newRDN rewriting (ITS#5834)
Fixed slapd syncrepl rename handling (ITS#5809)
Fixed slapd syncrepl MMR when adding new server (ITS#5850)
Fixed slapd-ldif numerous bugs (ITS#5408)
......
......@@ -355,8 +355,9 @@ modifyDN modify
modifyAttrDN modify AVA (DN portion of "ref" excluded)
referralAttrDN add/modify DN portion of referrals
(default to none)
modrDN modrdn
newSuperiorDN modrdn
renameDN modrdn (the old DN)
newSuperiorDN modrdn (the new parent DN, if any)
newRDN modrdn (the new relative DN)
deleteDN delete
exopPasswdDN password modify extended operation DN
.fi
......
......@@ -96,6 +96,12 @@ rwm_op_rollback( Operation *op, SlapReply *rs, rwm_op_state *ros )
op->orr_newSup = ros->orr_newSup;
op->orr_nnewSup = ros->orr_nnewSup;
}
if ( op->orr_newrdn.bv_val != ros->orr_newrdn.bv_val ) {
ch_free( op->orr_newrdn.bv_val );
ch_free( op->orr_nnewrdn.bv_val );
op->orr_newrdn = ros->orr_newrdn;
op->orr_nnewrdn = ros->orr_nnewrdn;
}
break;
case LDAP_REQ_SEARCH:
ch_free( ros->mapped_attrs );
......@@ -684,11 +690,11 @@ rwm_op_modrdn( Operation *op, SlapReply *rs )
(struct ldaprwmap *)on->on_bi.bi_private;
int rc;
dncookie dc;
rwm_op_cb *roc = rwm_callback_get( op, rs );
if ( op->orr_newSup ) {
dncookie dc;
struct berval nnewSup = BER_BVNULL;
struct berval newSup = BER_BVNULL;
......@@ -718,6 +724,32 @@ rwm_op_modrdn( Operation *op, SlapReply *rs )
}
}
/*
* Rewrite the newRDN, if needed
*/
{
struct berval newrdn = BER_BVNULL;
struct berval nnewrdn = BER_BVNULL;
dc.rwmap = rwmap;
dc.conn = op->o_conn;
dc.rs = rs;
dc.ctx = "newRDN";
newrdn = op->orr_newrdn;
nnewrdn = op->orr_nnewrdn;
rc = rwm_dn_massage_pretty_normalize( &dc, &op->orr_newrdn, &newrdn, &nnewrdn );
if ( rc != LDAP_SUCCESS ) {
op->o_bd->bd_info = (BackendInfo *)on->on_info;
send_ldap_error( op, rs, rc, "newRDN massage error" );
goto err;
}
if ( op->orr_newrdn.bv_val != newrdn.bv_val ) {
op->orr_newrdn = newrdn;
op->orr_nnewrdn = nnewrdn;
}
}
/*
* Rewrite the dn, if needed
*/
......@@ -725,6 +757,15 @@ rwm_op_modrdn( Operation *op, SlapReply *rs )
if ( rc != LDAP_SUCCESS ) {
op->o_bd->bd_info = (BackendInfo *)on->on_info;
send_ldap_error( op, rs, rc, "renameDN massage error" );
goto err;
}
op->o_callback = &roc->cb;
rc = SLAP_CB_CONTINUE;
if ( 0 ) {
err:;
if ( op->orr_newSup != roc->ros.orr_newSup ) {
ch_free( op->orr_newSup->bv_val );
ch_free( op->orr_nnewSup->bv_val );
......@@ -733,15 +774,16 @@ rwm_op_modrdn( Operation *op, SlapReply *rs )
op->orr_newSup = roc->ros.orr_newSup;
op->orr_nnewSup = roc->ros.orr_nnewSup;
}
return -1;
}
/* TODO: rewrite newRDN, attribute types,
* values of DN-valued attributes (hopefully not used in RDN)... */
op->o_callback = &roc->cb;
if ( op->orr_newrdn.bv_val != roc->ros.orr_newrdn.bv_val ) {
ch_free( op->orr_newrdn.bv_val );
ch_free( op->orr_nnewrdn.bv_val );
op->orr_newrdn = roc->ros.orr_newrdn;
op->orr_nnewrdn = roc->ros.orr_nnewrdn;
}
}
return SLAP_CB_CONTINUE;
return rc;
}
......
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