Deleted syncrepl updatedn

This commit is contained in:
Howard Chu 2005-01-13 18:51:29 +00:00
parent 69fbd2e66e
commit bf27ba977b
6 changed files with 5 additions and 89 deletions

View File

@ -1410,7 +1410,6 @@ with the inner suffix must come first in the configuration file.
.B [sizelimit=<limit>]
.B [timelimit=<limit>]
.B [schemachecking=on|off]
.B [updatedn=<dn>]
.B [bindmethod=simple|sasl]
.B [binddn=<dn>]
.B [saslmech=<mech>]
@ -1485,16 +1484,6 @@ The schema checking can be enforced at the LDAP Sync
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

View File

@ -626,12 +626,6 @@ be_isroot_dn( Backend *be, struct berval *ndn )
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 )
{
@ -642,8 +636,8 @@ 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

View File

@ -1649,9 +1649,6 @@ add_syncrepl(
}
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,
@ -1721,7 +1718,6 @@ add_syncrepl(
#define SLIMITSTR "sizelimit"
#define TLIMITSTR "timelimit"
#define SCHEMASTR "schemachecking"
#define UPDATEDNSTR "updatedn"
#define BINDMETHSTR "bindmethod"
#define SIMPLESTR "simple"
#define SASLSTR "sasl"
@ -1748,6 +1744,7 @@ add_syncrepl(
#define LMREQSTR "req"
#define SRVTABSTR "srvtab"
#define SUFFIXSTR "suffix"
#define UPDATEDNSTR "updatedn"
/* mandatory */
#define GOT_ID 0x0001
@ -1804,23 +1801,6 @@ parse_syncrepl_line(
} 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 "=" ) ) )
{

View File

@ -246,7 +246,6 @@ 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_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 ));
@ -1296,8 +1295,6 @@ LDAP_SLAPD_F (Entry*) slap_create_syncrepl_entry LDAP_P((
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 */

View File

@ -1482,7 +1482,6 @@ typedef struct syncinfo_s {
#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;

View File

@ -929,10 +929,10 @@ do_syncrepl(
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 ) {
@ -1217,8 +1217,6 @@ syncrepl_entry(
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;
@ -1327,11 +1325,7 @@ syncrepl_entry(
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 ) {
@ -1593,8 +1587,6 @@ syncrepl_del_nonpresent(
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;
@ -1698,13 +1690,7 @@ syncrepl_del_nonpresent(
}
}
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 &&
@ -1725,8 +1711,6 @@ syncrepl_del_nonpresent(
}
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;
@ -2080,30 +2064,6 @@ done :
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,
@ -2383,9 +2343,6 @@ syncinfo_free( syncinfo_t *sie )
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 );
}