mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-12 10:54:48 +08:00
propagate opattrs if shadow update
This commit is contained in:
parent
3118f1fd2e
commit
69fbd2e66e
@ -35,13 +35,14 @@
|
||||
int
|
||||
meta_back_add( Operation *op, SlapReply *rs )
|
||||
{
|
||||
struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
|
||||
struct metaconn *lc;
|
||||
int i, candidate = -1;
|
||||
Attribute *a;
|
||||
LDAPMod **attrs;
|
||||
struct berval mdn = BER_BVNULL, mapped;
|
||||
dncookie dc;
|
||||
struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
|
||||
struct metaconn *lc;
|
||||
int i, candidate = -1;
|
||||
int isupdate;
|
||||
Attribute *a;
|
||||
LDAPMod **attrs;
|
||||
struct berval mdn = BER_BVNULL, mapped;
|
||||
dncookie dc;
|
||||
|
||||
Debug(LDAP_DEBUG_ARGS, "==> meta_back_add: %s\n",
|
||||
op->o_req_dn.bv_val, 0, 0 );
|
||||
@ -81,10 +82,11 @@ meta_back_add( Operation *op, SlapReply *rs )
|
||||
/* Create array of LDAPMods for ldap_add() */
|
||||
attrs = ch_malloc( sizeof( LDAPMod * )*i );
|
||||
|
||||
isupdate = be_shadow_update( op );
|
||||
for ( i = 0, a = op->ora_e->e_attrs; a; a = a->a_next ) {
|
||||
int j;
|
||||
|
||||
if ( a->a_desc->ad_type->sat_no_user_mod ) {
|
||||
if ( !isupdate && a->a_desc->ad_type->sat_no_user_mod ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -34,16 +34,17 @@
|
||||
int
|
||||
meta_back_modify( Operation *op, SlapReply *rs )
|
||||
{
|
||||
struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
|
||||
struct metaconn *lc;
|
||||
int rc = 0;
|
||||
LDAPMod **modv = NULL;
|
||||
LDAPMod *mods = NULL;
|
||||
Modifications *ml;
|
||||
int candidate = -1, i;
|
||||
struct berval mdn = BER_BVNULL;
|
||||
struct berval mapped;
|
||||
dncookie dc;
|
||||
struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
|
||||
struct metaconn *lc;
|
||||
int rc = 0;
|
||||
LDAPMod **modv = NULL;
|
||||
LDAPMod *mods = NULL;
|
||||
Modifications *ml;
|
||||
int candidate = -1, i;
|
||||
int isupdate;
|
||||
struct berval mdn = BER_BVNULL;
|
||||
struct berval mapped;
|
||||
dncookie dc;
|
||||
|
||||
lc = meta_back_getconn( op, rs, META_OP_REQUIRE_SINGLE,
|
||||
&op->o_req_ndn, &candidate );
|
||||
@ -94,10 +95,11 @@ meta_back_modify( Operation *op, SlapReply *rs )
|
||||
}
|
||||
|
||||
dc.ctx = "modifyAttrDN";
|
||||
isupdate = be_shadow_update( op );
|
||||
for ( i = 0, ml = op->orm_modlist; ml; ml = ml->sml_next ) {
|
||||
int j;
|
||||
|
||||
if ( ml->sml_desc->ad_type->sat_no_user_mod ) {
|
||||
if ( !isupdate && ml->sml_desc->ad_type->sat_no_user_mod ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -96,6 +96,7 @@ rwm_op_add( Operation *op, SlapReply *rs )
|
||||
i;
|
||||
Attribute **ap = NULL;
|
||||
char *olddn = op->o_req_dn.bv_val;
|
||||
int isupdate;
|
||||
|
||||
#ifdef ENABLE_REWRITE
|
||||
rc = rwm_op_dn_massage( op, rs, "addDN" );
|
||||
@ -118,11 +119,12 @@ rwm_op_add( Operation *op, SlapReply *rs )
|
||||
}
|
||||
|
||||
/* Count number of attributes in entry */
|
||||
isupdate = be_shadow_update( op );
|
||||
for ( i = 0, ap = &op->oq_add.rs_e->e_attrs; *ap; ) {
|
||||
struct berval mapped;
|
||||
Attribute *a;
|
||||
|
||||
if ( (*ap)->a_desc->ad_type->sat_no_user_mod ) {
|
||||
if ( !isupdate && (*ap)->a_desc->ad_type->sat_no_user_mod ) {
|
||||
goto next_attr;
|
||||
}
|
||||
|
||||
@ -340,6 +342,7 @@ rwm_op_modify( Operation *op, SlapReply *rs )
|
||||
struct ldaprwmap *rwmap =
|
||||
(struct ldaprwmap *)on->on_bi.bi_private;
|
||||
|
||||
int isupdate;
|
||||
Modifications **mlp;
|
||||
int rc;
|
||||
|
||||
@ -355,11 +358,12 @@ rwm_op_modify( Operation *op, SlapReply *rs )
|
||||
return -1;
|
||||
}
|
||||
|
||||
isupdate = be_shadow_update( op );
|
||||
for ( mlp = &op->oq_modify.rs_modlist; *mlp; ) {
|
||||
int is_oc = 0;
|
||||
Modifications *ml;
|
||||
|
||||
if ( (*mlp)->sml_desc->ad_type->sat_no_user_mod ) {
|
||||
if ( !isupdate && (*mlp)->sml_desc->ad_type->sat_no_user_mod ) {
|
||||
goto next_mod;
|
||||
}
|
||||
|
||||
@ -745,6 +749,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
|
||||
dncookie dc;
|
||||
int rc;
|
||||
Attribute **ap;
|
||||
int isupdate;
|
||||
|
||||
/*
|
||||
* Rewrite the dn attrs, if needed
|
||||
@ -770,6 +775,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
|
||||
* an error (because multiple instances of attrs in
|
||||
* response are not valid), or merge the values (what
|
||||
* about duplicate values?) */
|
||||
isupdate = be_shadow_update( op );
|
||||
for ( ap = a_first; *ap; ) {
|
||||
struct ldapmapping *m;
|
||||
int drop_missing;
|
||||
@ -787,7 +793,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
|
||||
goto cleanup_attr;
|
||||
}
|
||||
|
||||
if ( (*ap)->a_desc->ad_type->sat_no_user_mod
|
||||
if ( !isupdate && (*ap)->a_desc->ad_type->sat_no_user_mod
|
||||
&& (*ap)->a_desc->ad_type != slap_schema.si_at_undefined )
|
||||
{
|
||||
goto next_attr;
|
||||
|
Loading…
Reference in New Issue
Block a user