int repl_user = be_isupdate( op );
#ifndef SLAPD_MULTIMASTER
if ( !SLAP_SHADOW(op->o_bd) || repl_user )
-#else
- if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo ))
#endif
{
int update = op->o_bd->be_update_ndn.bv_len;
* no parent!
* if not attempting to add entry at suffix or with parent ""
*/
- if ((( !be_isroot( op ) && !be_isupdate(op)) || pdn.bv_len > 0 )
- && !is_entry_glue( op->oq_add.rs_e ))
+ if ((( !be_isroot( op ) && !be_isupdate(op) && !syncrepl_isupdate(op))
+ || pdn.bv_len > 0 ) && !is_entry_glue( op->oq_add.rs_e ))
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1, "bdb_add: %s denied\n",
/* no parent, must be root to delete */
if( ! be_isroot( op ) ) {
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
- || be_isupdate( op ) ) {
+ || be_isupdate( op ) || syncrepl_isupdate( op ) ) {
p = (Entry *)&slap_entry_root;
/* check parent for "children" acl */
isroot = be_isroot( op );
if ( ! isroot ) {
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
- || be_isupdate( op ) ) {
+ || be_isupdate( op ) || syncrepl_isupdate( op ) ) {
p = (Entry *)&slap_entry_root;
dc.ctx = "addAttrDN";
#endif
- isupdate = be_isupdate( op );
+ isupdate = be_isupdate( op ) || syncrepl_isupdate( op );
for (i=0, a=op->oq_add.rs_e->e_attrs; a; a=a->a_next) {
if ( !isupdate && a->a_desc->ad_type->sat_no_user_mod ) {
continue;
dc.ctx = "modifyAttrDN";
#endif
- isupdate = be_isupdate( op );
+ isupdate = be_isupdate( op ) || syncrepl_isupdate( op );
for (i=0, ml=op->oq_modify.rs_modlist; ml; ml=ml->sml_next) {
int is_oc = 0;
} else {
assert( pdn.bv_val == NULL || *pdn.bv_val == '\0' );
- if (( !be_isroot( op ) && !be_isupdate( op )) &&
- !is_entry_glue( op->oq_add.rs_e ))
+ if (( !be_isroot(op) && !be_isupdate(op) && !syncrepl_isupdate(op))
+ && !is_entry_glue( op->oq_add.rs_e ))
{
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
} else {
/* no parent, must be root to delete */
if( ! be_isroot( op ) ) {
- if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op ) ) {
+ if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
+ || be_isupdate( op ) || syncrepl_isupdate( op ) ) {
p = (Entry *)&slap_entry_root;
rc = access_allowed( op, p,
/* no parent, must be root to modify rdn */
isroot = be_isroot( op );
if ( ! isroot ) {
- if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op ) ) {
+ if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
+ || be_isupdate( op ) || syncrepl_isupdate( op ) ) {
int can_access;
p = (Entry *)&slap_entry_root;
}
if ( ! isroot ) {
- if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op ) ) {
+ if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
+ || be_isupdate( op ) || syncrepl_isupdate( op )) {
int can_access;
np = (Entry *)&slap_entry_root;
int
be_isupdate( Operation *op )
{
- return be_isupdate_dn( op->o_bd, &op->o_ndn );
+ return ( be_isupdate_dn( op->o_bd, &op->o_ndn ));
}
int
int repl_user = be_isupdate( op );
#ifndef SLAPD_MULTIMASTER
if ( !SLAP_SHADOW(op->o_bd) || repl_user )
-#else
- if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo ))
#endif
{
slap_callback cb = { NULL, slap_replog_cb, NULL, NULL };
*/
#ifndef SLAPD_MULTIMASTER
if ( !SLAP_SHADOW(op->o_bd) || repl_user )
-#else
- if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo ))
#endif
{
int update = op->o_bd->be_update_ndn.bv_len;
int repl_user = be_isupdate( op );
#ifndef SLAPD_MULTIMASTER
if ( !SLAP_SHADOW(op->o_bd) || repl_user )
-#else
- if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo ))
#endif
{
slap_callback cb = { NULL, slap_replog_cb, NULL, NULL };
}
/* Count number of attributes in entry */
- isupdate = be_isupdate( op );
+ isupdate = be_isupdate( op ) || syncrepl_isupdate( op );
for ( i = 0, ap = &op->oq_add.rs_e->e_attrs; *ap; ) {
struct berval mapped;
Attribute *a;
struct berval *, struct berval * ));
LDAP_SLAPD_F (struct berval *) slap_uuidstr_from_normalized LDAP_P((
struct berval *, struct berval *, void * ));
+LDAP_SLAPD_F (int) syncrepl_isupdate LDAP_P(( Operation * ));
+LDAP_SLAPD_F (int) syncrepl_isupdate_dn LDAP_P(( Backend *, struct berval * ));
/* syntax.c */
LDAP_SLAPD_F (Syntax *) syn_find LDAP_P((
return;
}
+int
+syncrepl_isupdate( Operation *op )
+{
+ return ( syncrepl_isupdate_dn( op->o_bd, &op->o_ndn ));
+}
+
+int
+syncrepl_isupdate_dn(
+ Backend* be,
+ struct berval* ndn
+)
+{
+ syncinfo_t* si;
+ int ret = 0;
+
+ if ( !LDAP_STAILQ_EMPTY( &be->be_syncinfo )) {
+ LDAP_STAILQ_FOREACH( si, &be->be_syncinfo, si_next ) {
+ if ( ret = dn_match( &si->si_updatedn, ndn )) {
+ return ret;
+ }
+ }
+ }
+ return 0;
+}
+
static int
dn_callback(
Operation* op,
}
ch_free ( (char *) bv );
}
-