]> git.sur5r.net Git - openldap/commitdiff
more about ITS#5940
authorPierangelo Masarati <ando@openldap.org>
Fri, 13 Feb 2009 00:02:11 +0000 (00:02 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 13 Feb 2009 00:02:11 +0000 (00:02 +0000)
servers/slapd/backover.c
servers/slapd/bconfig.c
servers/slapd/overlays/rwm.c

index 8194e9869fb0fc7948966b348a2f0683d176332f..d69cf12c06b24781ea34923c856395c57f44f88c 100644 (file)
@@ -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;
index 6e3efd65f93f122706577270b4d25d3347c28fe7..a7f8b768e12952336174cb63dcd1e11d46e1633e 100644 (file)
@@ -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] == '{' )
        {
index 070d4b3f7097de73e87e1df5c82752eb514d2627..8f81e040b5d647692275f228056652383dc8b0c0 100644 (file)
@@ -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 );