* no parent!
* if not attempting to add entry at suffix or with parent ""
*/
- if ((( !be_isroot( op ) && !be_isupdate(op) && !syncrepl_isupdate(op))
+ if ((( !be_isroot( op ) && !be_shadow_update(op) )
|| pdn.bv_len > 0 ) && !is_entry_glue( op->oq_add.rs_e ))
{
#ifdef NEW_LOGGING
/* 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 ) || syncrepl_isupdate( op ) ) {
+ || be_shadow_update( 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 ) || syncrepl_isupdate( op ) ) {
+ || be_shadow_update( op ) ) {
p = (Entry *)&slap_entry_root;
dc.ctx = "addAttrDN";
#endif
- isupdate = be_isupdate( op ) || syncrepl_isupdate( op );
+ isupdate = be_shadow_update( 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 ) || syncrepl_isupdate( op );
+ isupdate = be_shadow_update( 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) && !syncrepl_isupdate(op))
+ if (( !be_isroot(op) && !be_shadow_update(op) )
&& !is_entry_glue( op->oq_add.rs_e ))
{
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
/* 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 ) || syncrepl_isupdate( op ) ) {
+ || be_shadow_update( op ) ) {
p = (Entry *)&slap_entry_root;
rc = access_allowed( op, p,
isroot = be_isroot( op );
if ( ! isroot ) {
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
- || be_isupdate( op ) || syncrepl_isupdate( op ) ) {
+ || be_shadow_update( 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 ) || syncrepl_isupdate( op )) {
+ || be_shadow_update( op ) ) {
int can_access;
np = (Entry *)&slap_entry_root;
}
int
-be_isupdate( Operation *op )
+be_sync_update( Operation *op )
{
- return ( be_isupdate_dn( op->o_bd, &op->o_ndn ));
+ return ( SLAP_SYNC_SHADOW( op->o_bd ) && syncrepl_isupdate( op ) );
+}
+
+int
+be_slurp_update( Operation *op )
+{
+ return ( SLAP_SLURP_SHADOW( op->o_bd ) && be_isupdate_dn( op->o_bd, &op->o_ndn ));
+}
+
+int
+be_shadow_update( Operation *op )
+{
+#if 0
+ return ( be_sync_update( op ) || be_slurp_update( op ) );
+#endif
+ /* NOTE: this is slightly more efficient */
+ return ( SLAP_SHADOW( op->o_bd ) && ( syncrepl_isupdate( op ) || be_isupdate_dn( op->o_bd, &op->o_ndn ) ) );
}
int
}
/* Count number of attributes in entry */
- isupdate = be_isupdate( op ) || syncrepl_isupdate( op );
+ isupdate = be_shadow_update( op );
for ( i = 0, ap = &op->oq_add.rs_e->e_attrs; *ap; ) {
struct berval mapped;
Attribute *a;
LDAP_SLAPD_F (int) be_isroot LDAP_P(( Operation *op ));
LDAP_SLAPD_F (int) be_isroot_dn LDAP_P(( Backend *be, struct berval *ndn ));
LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Operation *op ));
-LDAP_SLAPD_F (int) be_isupdate LDAP_P(( Operation *op ));
+LDAP_SLAPD_F (int) be_sync_update LDAP_P(( Operation *op ));
+LDAP_SLAPD_F (int) be_slurp_update LDAP_P(( Operation *op ));
+#define be_isupdate( op ) be_slurp_update( (op) )
+LDAP_SLAPD_F (int) be_shadow_update LDAP_P(( Operation *op ));
LDAP_SLAPD_F (int) be_isupdate_dn LDAP_P(( Backend *be, struct berval *ndn ));
LDAP_SLAPD_F (struct berval *) be_root_dn LDAP_P(( Backend *be ));
LDAP_SLAPD_F (int) be_entry_get_rw LDAP_P(( struct slap_op *o,
#define SLAP_DBFLAG_NOLASTMOD 0x0001U
#define SLAP_DBFLAG_NO_SCHEMA_CHECK 0x0002U
#define SLAP_DBFLAG_GLUE_INSTANCE 0x0010U /* a glue backend */
-#define SLAP_DBFLAG_GLUE_SUBORDINATE 0x0020U /* child of a glue hierarchy */
+#define SLAP_DBFLAG_GLUE_SUBORDINATE 0x0020U /* child of a glue hierarchy */
#define SLAP_DBFLAG_GLUE_LINKED 0x0040U /* child is connected to parent */
-#define SLAP_DBFLAG_SHADOW 0x8000U /* a shadow */
+#define SLAP_DBFLAG_SHADOW 0x8000U /* a shadow */
#define SLAP_DBFLAG_SYNC_SHADOW 0x1000U /* a sync shadow */
#define SLAP_DBFLAG_SLURP_SHADOW 0x2000U /* a slurp shadow */
slap_mask_t be_flags;
#define SLAP_GLUE_LINKED(be) \
(SLAP_DBFLAGS(be) & SLAP_DBFLAG_GLUE_LINKED)
#define SLAP_SHADOW(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SHADOW)
+#define SLAP_SYNC_SHADOW(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SYNC_SHADOW)
+#define SLAP_SLURP_SHADOW(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SLURP_SHADOW)
slap_mask_t be_restrictops; /* restriction operations */
#define SLAP_RESTRICT_OP_ADD 0x0001U