From a83d10e4ac33c5f8c2f51755c39653c2a2cf0ae7 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 13 Feb 2009 00:02:11 +0000 Subject: [PATCH] more about ITS#5940 --- servers/slapd/backover.c | 2 ++ servers/slapd/bconfig.c | 4 ++-- servers/slapd/overlays/rwm.c | 9 ++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index 8194e9869f..d69cf12c06 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -103,6 +103,8 @@ over_db_config( ca.be = be; snprintf( ca.log, sizeof( ca.log ), "%s: line %d", ca.fname, ca.lineno ); + ca.op = SLAP_CONFIG_ADD; + ca.valx = -1; for (; on; on=on->on_next) { rc = SLAP_CONF_UNKNOWN; diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 6e3efd65f9..a7f8b768e1 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -4488,6 +4488,7 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs, if ( !ct ) continue; /* user data? */ for (i=0; a->a_vals[i].bv_val; i++) { char *iptr = NULL; + ca->valx = -1; ca->line = a->a_vals[i].bv_val; if ( a->a_desc->ad_type->sat_flags & SLAP_AT_ORDERED ) { ptr = strchr( ca->line, '}' ); @@ -4499,8 +4500,6 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs, if ( a->a_desc->ad_type->sat_flags & SLAP_AT_ORDERED_SIB ) { if ( iptr ) { ca->valx = strtol( iptr+1, NULL, 0 ); - } else { - ca->valx = -1; } } else { ca->valx = i; @@ -4789,6 +4788,7 @@ config_modify_add( ConfigTable *ct, ConfigArgs *ca, AttributeDescription *ad, { int rc; + ca->valx = -1; if (ad->ad_type->sat_flags & SLAP_AT_ORDERED && ca->line[0] == '{' ) { diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index 070d4b3f70..8f81e040b5 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -2061,7 +2061,6 @@ rwm_cf_gen( ConfigArgs *c ) switch ( c->type ) { case RWM_CF_REWRITE: if ( c->valx >= 0 ) { - /* single modification is not allowed */ rc = 1; } else if ( rwmap->rwm_rw != NULL ) { @@ -2116,6 +2115,10 @@ rwm_cf_gen( ConfigArgs *c ) switch ( c->type ) { case RWM_CF_REWRITE: + if ( c->valx >= 0 ) { + return 1; + } + argv0 = c->argv[ idx0 ]; if ( strncasecmp( argv0, "rwm-", STRLENOF( "rwm-" ) ) != 0 ) { return 1; @@ -2150,6 +2153,10 @@ rwm_cf_gen( ConfigArgs *c ) break; case RWM_CF_MAP: + if ( c->valx >= 0 ) { + return 1; + } + argv0 = c->argv[ 0 ]; c->argv[ 0 ] += STRLENOF( "rwm-" ); rc = rwm_m_config( &db, c->fname, c->lineno, c->argc, c->argv ); -- 2.39.5