*/
if ( be->be_add ) {
/* do the update here */
- int repl_user = (be->be_update_ndn != NULL &&
- strcmp( be->be_update_ndn, op->o_ndn ) == 0);
+ int repl_user = be_isupdate(be, op->o_ndn );
#ifndef SLAPD_MULTIMASTER
if ( be->be_update_ndn == NULL || repl_user )
#endif
return(rc);
}
+int
+be_isupdate( Backend *be, const char *ndn )
+{
+ int rc;
+
+ if ( ndn == NULL || *ndn == '\0' ) {
+ return( 0 );
+ }
+
+ if ( be->be_update_ndn == NULL || *be->be_update_ndn == '\0' ) {
+ return( 0 );
+ }
+
+ rc = strcmp( be->be_update_ndn, ndn ) ? 0 : 1;
+
+ return(rc);
+}
+
char *
be_root_dn( Backend *be )
{
if ( be->be_delete ) {
/* do the update here */
#ifndef SLAPD_MULTIMASTER
- if ( be->be_update_ndn == NULL ||
- strcmp( be->be_update_ndn, op->o_ndn ) == 0 )
+ int repl_user = be_isupdate( be, op->o_ndn );
+ if ( be->be_update_ndn == NULL || repl_user )
#endif
{
if ( (*be->be_delete)( be, conn, op, dn, ndn ) == 0 ) {
#ifdef SLAPD_MULTIMASTER
- if (be->be_update_ndn == NULL ||
- strcmp( be->be_update_ndn, op->o_ndn ))
+ if (be->be_update_ndn == NULL || !repl_user )
#endif
{
replog( be, op, dn, NULL );
*/
if ( be->be_modify ) {
/* do the update here */
- int repl_user = (be->be_update_ndn != NULL &&
- strcmp( be->be_update_ndn, op->o_ndn ) == 0);
+ int repl_user = be_isupdate( be, op->o_ndn );
#ifndef SLAPD_MULTIMASTER
/* Multimaster slapd does not have to check for replicator dn
* because it accepts each modify request
if ( be->be_modrdn ) {
/* do the update here */
#ifndef SLAPD_MULTIMASTER
- if ( be->be_update_ndn == NULL ||
- strcmp( be->be_update_ndn, op->o_ndn ) == 0 )
+ int repl_user = be_isupdate( be, op->o_ndn );
+ if ( be->be_update_ndn == NULL || repl_user )
#endif
{
if ( (*be->be_modrdn)( be, conn, op, dn, ndn, newrdn,
deloldrdn, newSuperior ) == 0
#ifdef SLAPD_MULTIMASTER
- && ( be->be_update_ndn == NULL ||
- strcmp( be->be_update_ndn, op->o_ndn ) )
+ && ( be->be_update_ndn == NULL || !repl_user )
#endif
) {
struct replog_moddn moddn;
LDAP_SLAPD_F (int) be_isroot LDAP_P(( Backend *be, const char *ndn ));
LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Backend *be,
Connection *conn, const char *ndn, struct berval *cred ));
+LDAP_SLAPD_F (int) be_isupdate LDAP_P(( Backend *be, const char *ndn ));
LDAP_SLAPD_F (char *) be_root_dn LDAP_P(( Backend *be ));
LDAP_SLAPD_F (int) be_entry_release_rw LDAP_P((
BackendDB *be, Connection *c, Operation *o, Entry *e, int rw ));