mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 16:19:35 -05:00
first round of SHADOW flags/isupdate test unification
This commit is contained in:
parent
b703cfb008
commit
c0c24cfec5
12 changed files with 36 additions and 15 deletions
|
|
@ -298,7 +298,7 @@ retry: /* transaction retry */
|
||||||
* no parent!
|
* no parent!
|
||||||
* if not attempting to add entry at suffix or with 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 ))
|
|| pdn.bv_len > 0 ) && !is_entry_glue( op->oq_add.rs_e ))
|
||||||
{
|
{
|
||||||
#ifdef NEW_LOGGING
|
#ifdef NEW_LOGGING
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,7 @@ retry: /* transaction retry */
|
||||||
/* no parent, must be root to delete */
|
/* no parent, must be root to delete */
|
||||||
if( ! be_isroot( op ) ) {
|
if( ! be_isroot( op ) ) {
|
||||||
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
|
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;
|
p = (Entry *)&slap_entry_root;
|
||||||
|
|
||||||
/* check parent for "children" acl */
|
/* check parent for "children" acl */
|
||||||
|
|
|
||||||
|
|
@ -396,7 +396,7 @@ retry: /* transaction retry */
|
||||||
isroot = be_isroot( op );
|
isroot = be_isroot( op );
|
||||||
if ( ! isroot ) {
|
if ( ! isroot ) {
|
||||||
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
|
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;
|
p = (Entry *)&slap_entry_root;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ ldap_back_add(
|
||||||
dc.ctx = "addAttrDN";
|
dc.ctx = "addAttrDN";
|
||||||
#endif
|
#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) {
|
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 ) {
|
if ( !isupdate && a->a_desc->ad_type->sat_no_user_mod ) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ ldap_back_modify(
|
||||||
dc.ctx = "modifyAttrDN";
|
dc.ctx = "modifyAttrDN";
|
||||||
#endif
|
#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) {
|
for (i=0, ml=op->oq_modify.rs_modlist; ml; ml=ml->sml_next) {
|
||||||
int is_oc = 0;
|
int is_oc = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ ldbm_back_add(
|
||||||
} else {
|
} else {
|
||||||
assert( pdn.bv_val == NULL || *pdn.bv_val == '\0' );
|
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 ))
|
&& !is_entry_glue( op->oq_add.rs_e ))
|
||||||
{
|
{
|
||||||
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
|
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ ldbm_back_delete(
|
||||||
/* no parent, must be root to delete */
|
/* no parent, must be root to delete */
|
||||||
if( ! be_isroot( op ) ) {
|
if( ! be_isroot( op ) ) {
|
||||||
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
|
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;
|
p = (Entry *)&slap_entry_root;
|
||||||
|
|
||||||
rc = access_allowed( op, p,
|
rc = access_allowed( op, p,
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ ldbm_back_modrdn(
|
||||||
isroot = be_isroot( op );
|
isroot = be_isroot( op );
|
||||||
if ( ! isroot ) {
|
if ( ! isroot ) {
|
||||||
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
|
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
|
||||||
|| be_isupdate( op ) || syncrepl_isupdate( op ) ) {
|
|| be_shadow_update( op ) ) {
|
||||||
int can_access;
|
int can_access;
|
||||||
p = (Entry *)&slap_entry_root;
|
p = (Entry *)&slap_entry_root;
|
||||||
|
|
||||||
|
|
@ -424,7 +424,7 @@ ldbm_back_modrdn(
|
||||||
|
|
||||||
if ( ! isroot ) {
|
if ( ! isroot ) {
|
||||||
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
|
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
|
||||||
|| be_isupdate( op ) || syncrepl_isupdate( op )) {
|
|| be_shadow_update( op ) ) {
|
||||||
int can_access;
|
int can_access;
|
||||||
np = (Entry *)&slap_entry_root;
|
np = (Entry *)&slap_entry_root;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -728,9 +728,25 @@ be_isroot_dn( Backend *be, struct berval *ndn )
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
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
|
int
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ rwm_add( Operation *op, SlapReply *rs )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Count number of attributes in entry */
|
/* 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; ) {
|
for ( i = 0, ap = &op->oq_add.rs_e->e_attrs; *ap; ) {
|
||||||
struct berval mapped;
|
struct berval mapped;
|
||||||
Attribute *a;
|
Attribute *a;
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,10 @@ LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be,
|
||||||
LDAP_SLAPD_F (int) be_isroot LDAP_P(( Operation *op ));
|
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_dn LDAP_P(( Backend *be, struct berval *ndn ));
|
||||||
LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Operation *op ));
|
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 (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 (struct berval *) be_root_dn LDAP_P(( Backend *be ));
|
||||||
LDAP_SLAPD_F (int) be_entry_get_rw LDAP_P(( struct slap_op *o,
|
LDAP_SLAPD_F (int) be_entry_get_rw LDAP_P(( struct slap_op *o,
|
||||||
|
|
|
||||||
|
|
@ -1468,6 +1468,8 @@ struct slap_backend_db {
|
||||||
#define SLAP_GLUE_LINKED(be) \
|
#define SLAP_GLUE_LINKED(be) \
|
||||||
(SLAP_DBFLAGS(be) & SLAP_DBFLAG_GLUE_LINKED)
|
(SLAP_DBFLAGS(be) & SLAP_DBFLAG_GLUE_LINKED)
|
||||||
#define SLAP_SHADOW(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SHADOW)
|
#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 */
|
slap_mask_t be_restrictops; /* restriction operations */
|
||||||
#define SLAP_RESTRICT_OP_ADD 0x0001U
|
#define SLAP_RESTRICT_OP_ADD 0x0001U
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue