]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9953 Check for push replication
authorOndřej Kuzník <ondra@mistotebe.net>
Thu, 16 Feb 2023 14:50:43 +0000 (14:50 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 26 Apr 2023 20:10:16 +0000 (20:10 +0000)
contrib/slapd-modules/variant/variant.c
servers/slapd/overlays/constraint.c
servers/slapd/overlays/ppolicy.c
servers/slapd/overlays/unique.c

index edf4832843217b2e935cb3ba9686870c78f9a6d3..d34b9d2c377fbdc53fe0e5dd9c5cc8b2c6def339 100644 (file)
@@ -282,9 +282,7 @@ variant_op_add( Operation *op, SlapReply *rs )
        variantEntry_info *vei;
        int rc;
 
-       /* Replication always uses the rootdn */
-       if ( ov->passReplication && SLAPD_SYNC_IS_SYNCCONN(op->o_connid) &&
-                       be_isroot( op ) ) {
+       if ( ov->passReplication && be_shadow_update( op ) ) {
                return SLAP_CB_CONTINUE;
        }
 
@@ -431,9 +429,7 @@ variant_op_mod( Operation *op, SlapReply *rs )
        regmatch_t pmatch[10];
        int rc, nmatch = sizeof(pmatch) / sizeof(regmatch_t);
 
-       /* Replication always uses the rootdn */
-       if ( ov->passReplication && SLAPD_SYNC_IS_SYNCCONN(op->o_connid) &&
-                       be_isroot( op ) ) {
+       if ( ov->passReplication && be_shadow_update( op ) ) {
                return SLAP_CB_CONTINUE;
        }
 
index 1feff7a8e00b8258d2a114281e7a201c891aa0d5..c691f0b8075292fedc825054d073308eee92e4ef 100644 (file)
@@ -816,7 +816,7 @@ constraint_add( Operation *op, SlapReply *rs )
        int rc = 0;
        char *msg = NULL;
 
-       if (get_relax(op) || SLAPD_SYNC_IS_SYNCCONN( op->o_connid )) {
+       if ( get_relax(op) || be_shadow_update( op ) ) {
                return SLAP_CB_CONTINUE;
        }
 
@@ -958,7 +958,7 @@ constraint_update( Operation *op, SlapReply *rs )
        char *msg = NULL;
        int is_v;
 
-       if (get_relax(op) || SLAPD_SYNC_IS_SYNCCONN( op->o_connid )) {
+       if ( get_relax(op) || be_shadow_update( op ) ) {
                return SLAP_CB_CONTINUE;
        }
 
index a3f2e709aa80a7a9275f15e2e24535bdd524eb55..cc4e60c5c679ce9efc712ba90a4e76a5f00a4652 100644 (file)
@@ -2223,7 +2223,7 @@ ppolicy_add(
                return rs->sr_err;
 
        /* If this is a replica, assume the provider checked everything */
-       if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) )
+       if ( be_shadow_update( op ) )
                return SLAP_CB_CONTINUE;
 
        ppolicy_get( op, op->ora_e, &pp );
@@ -2390,7 +2390,7 @@ ppolicy_modify( Operation *op, SlapReply *rs )
        /* If this is a replica, we may need to tweak some of the
         * provider's modifications. Otherwise, just pass it through.
         */
-       if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) ) {
+       if ( be_shadow_update( op ) ) {
                Modifications **prev;
                Attribute *a_grace, *a_lock, *a_fail, *a_success;
 
index 7a7c8fb540d1e2ba2cab651a82313edc98ce86fb..7ff128a28f3919731c00cc09bc1a4650665bf2e0 100644 (file)
@@ -1073,7 +1073,7 @@ unique_add(
        Debug(LDAP_DEBUG_TRACE, "==> unique_add <%s>\n",
              op->o_req_dn.bv_val );
 
-       if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) || (
+       if ( be_shadow_update( op ) || (
                        get_relax(op) > SLAP_CONTROL_IGNORED
                        && access_allowed( op, op->ora_e,
                                slap_schema.si_ad_entry, NULL,
@@ -1225,7 +1225,7 @@ unique_modify(
                return rc;
        }
 
-       if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) ) {
+       if ( be_shadow_update( op ) ) {
                return rc;
        }
        if ( get_relax(op) > SLAP_CONTROL_IGNORED
@@ -1365,7 +1365,7 @@ unique_modrdn(
        Debug(LDAP_DEBUG_TRACE, "==> unique_modrdn <%s> <%s>\n",
                op->o_req_dn.bv_val, op->orr_newrdn.bv_val );
 
-       if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) ) {
+       if ( be_shadow_update( op ) ) {
                return rc;
        }
        if ( get_relax(op) > SLAP_CONTROL_IGNORED