.B [sizelimit=<limit>]
.B [timelimit=<limit>]
.B [schemachecking=on|off]
-.B [updatedn=<dn>]
.B [bindmethod=simple|sasl]
.B [binddn=<dn>]
.B [saslmech=<mech>]
consumer site by turning on the
.B schemachecking
parameter. The default is off.
-The
-.B updatedn
-parameter specifies the DN in the consumer site
-which is allowed to make changes to the replica.
-The DN should have read/write access to the replica database.
-Generally, this DN
-.I should not
-be the same as the
-.B rootdn
-of the master database.
A
.B bindmethod
of
return dn_match( &be->be_rootndn, ndn );
}
-int
-be_sync_update( Operation *op )
-{
- return ( SLAP_SYNC_SHADOW( op->o_bd ) && syncrepl_isupdate( op ) );
-}
-
int
be_slurp_update( Operation *op )
{
int
be_shadow_update( Operation *op )
{
- return ( SLAP_SHADOW( op->o_bd ) &&
- ( syncrepl_isupdate( op ) || be_isupdate_dn( op->o_bd, &op->o_ndn )));
+ return ( SLAP_SYNC_SHADOW( op->o_bd ) ||
+ ( SLAP_SHADOW( op->o_bd ) && be_isupdate_dn( op->o_bd, &op->o_ndn )));
}
int
}
si->si_tls = SYNCINFO_TLS_OFF;
- if ( be->be_rootndn.bv_val ) {
- ber_dupbv( &si->si_updatedn, &be->be_rootndn );
- }
si->si_bindmethod = LDAP_AUTH_SIMPLE;
si->si_schemachecking = 0;
ber_str2bv( "(objectclass=*)", STRLENOF("(objectclass=*)"), 1,
#define SLIMITSTR "sizelimit"
#define TLIMITSTR "timelimit"
#define SCHEMASTR "schemachecking"
-#define UPDATEDNSTR "updatedn"
#define BINDMETHSTR "bindmethod"
#define SIMPLESTR "simple"
#define SASLSTR "sasl"
#define LMREQSTR "req"
#define SRVTABSTR "srvtab"
#define SUFFIXSTR "suffix"
+#define UPDATEDNSTR "updatedn"
/* mandatory */
#define GOT_ID 0x0001
} else {
si->si_tls = SYNCINFO_TLS_ON;
}
- } else if ( !strncasecmp( cargv[ i ], UPDATEDNSTR "=",
- STRLENOF( UPDATEDNSTR "=" ) ) )
- {
- struct berval updatedn = BER_BVNULL;
- int rc;
-
- val = cargv[ i ] + STRLENOF( UPDATEDNSTR "=" );
- ber_str2bv( val, 0, 0, &updatedn );
- ch_free( si->si_updatedn.bv_val );
- rc = dnNormalize( 0, NULL, NULL, &updatedn, &si->si_updatedn, NULL );
- if ( rc != LDAP_SUCCESS ) {
- fprintf( stderr, "Error: parse_syncrepl_line: "
- "update DN \"%s\" is invalid: %d (%s)\n",
- updatedn, rc, ldap_err2string( rc ) );
- return -1;
- }
-
} else if ( !strncasecmp( cargv[ i ], BINDMETHSTR "=",
STRLENOF( BINDMETHSTR "=" ) ) )
{
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_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 ));
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 * ));
LDAP_SLAPD_F (void) syncinfo_free LDAP_P(( syncinfo_t * ));
/* syntax.c */
#define SYNCINFO_TLS_ON 1
#define SYNCINFO_TLS_CRITICAL 2
int si_tls;
- struct berval si_updatedn;
int si_bindmethod;
char *si_binddn;
char *si_passwd;
op->o_tmpmemctx = NULL;
op->o_tmpmfuncs = &ch_mfuncs;
- op->o_dn = si->si_updatedn;
- op->o_ndn = si->si_updatedn;
op->o_managedsait = SLAP_CONTROL_NONCRITICAL;
op->o_bd = be = si->si_be;
+ op->o_dn = op->o_bd->be_rootdn;
+ op->o_ndn = op->o_bd->be_rootndn;
/* Establish session, do search */
if ( !si->si_ld ) {
struct berval pdn = BER_BVNULL;
struct berval org_req_dn = BER_BVNULL;
struct berval org_req_ndn = BER_BVNULL;
- struct berval org_dn = BER_BVNULL;
- struct berval org_ndn = BER_BVNULL;
int org_managedsait;
dninfo dni = {0};
int retry = 1;
org_req_dn = op->o_req_dn;
org_req_ndn = op->o_req_ndn;
- org_dn = op->o_dn;
- org_ndn = op->o_ndn;
org_managedsait = get_manageDSAit( op );
- op->o_dn = op->o_bd->be_rootdn;
- op->o_ndn = op->o_bd->be_rootndn;
op->o_managedsait = SLAP_CONTROL_NONCRITICAL;
if ( syncstate != LDAP_SYNC_DELETE ) {
struct berval pdn = BER_BVNULL;
struct berval org_req_dn = BER_BVNULL;
struct berval org_req_ndn = BER_BVNULL;
- struct berval org_dn = BER_BVNULL;
- struct berval org_ndn = BER_BVNULL;
int org_managedsait;
op->o_req_dn = si->si_base;
}
}
- org_req_dn = op->o_req_dn;
- org_req_ndn = op->o_req_ndn;
- org_dn = op->o_dn;
- org_ndn = op->o_ndn;
org_managedsait = get_manageDSAit( op );
- op->o_dn = op->o_bd->be_rootdn;
- op->o_ndn = op->o_bd->be_rootndn;
op->o_managedsait = SLAP_CONTROL_NONCRITICAL;
while ( rs_delete.sr_err == LDAP_SUCCESS &&
}
op->o_managedsait = org_managedsait;
- op->o_dn = org_dn;
- op->o_ndn = org_ndn;
op->o_req_dn = org_req_dn;
op->o_req_ndn = org_req_ndn;
op->o_delete_glue_parent = 0;
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,
if ( sie->si_provideruri_bv ) {
ber_bvarray_free( sie->si_provideruri_bv );
}
- if ( sie->si_updatedn.bv_val ) {
- ch_free( sie->si_updatedn.bv_val );
- }
if ( sie->si_binddn ) {
ch_free( sie->si_binddn );
}