From 9992d5c43a31265cf840d3972eb132732f8dccf2 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 21 Nov 2009 07:13:48 +0000 Subject: [PATCH] Ignore attempts to Add cn=schema,cn=config --- servers/slapd/bconfig.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 7b692971c4..7dee51a505 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -4705,6 +4705,9 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs, Debug( LDAP_DEBUG_TRACE, "%s: config_add_internal: " "DN=\"%s\" already exists\n", log_prefix, e->e_name.bv_val, 0 ); + /* global schema ignores all writes */ + if ( ce->ce_type == Cft_Schema && ce->ce_parent->ce_type == Cft_Global ) + return LDAP_COMPARE_TRUE; return LDAP_ALREADY_EXISTS; } } @@ -5190,7 +5193,14 @@ out2:; ldap_pvt_thread_pool_resume( &connection_pool ); out:; - send_ldap_result( op, rs ); + { int repl = op->o_dont_replicate; + if ( rs->sr_err == LDAP_COMPARE_TRUE ) { + rs->sr_err = LDAP_SUCCESS; + op->o_dont_replicate = 1; + } + send_ldap_result( op, rs ); + op->o_dont_replicate = repl; + } slap_graduate_commit_csn( op ); return rs->sr_err; } -- 2.39.5