]> git.sur5r.net Git - openldap/commitdiff
ITS#3815 fix olcDbConfig parsing
authorHoward Chu <hyc@openldap.org>
Fri, 1 Jul 2005 02:08:14 +0000 (02:08 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 1 Jul 2005 02:08:14 +0000 (02:08 +0000)
servers/slapd/back-bdb/config.c

index ec013a251293c54269912704292b892539838988..fef94300aed32dedb07efd92707dccb1b0b8e174 100644 (file)
@@ -509,10 +509,21 @@ bdb_cf_gen(ConfigArgs *c)
                break;
 
        case BDB_CONFIG: {
-               char *ptr = c->line + STRLENOF("dbconfig");
+               char *ptr = c->line;
                struct berval bv;
-               while (!isspace(*ptr)) ptr++;
-               while (isspace(*ptr)) ptr++;
+
+               if ( c->op == SLAP_CONFIG_ADD ) {
+                       ptr += STRLENOF("dbconfig");
+                       while (!isspace(*ptr)) ptr++;
+                       while (isspace(*ptr)) ptr++;
+               } else {
+                       if (*ptr == '{') {
+                               ptr = strchr( ptr+1, '}');
+                               if (!ptr)
+                                       return(1);
+                               ptr++;
+                       }
+               }
                
                if ( bdb->bi_flags & BDB_IS_OPEN ) {
                        bdb->bi_flags |= BDB_UPD_CONFIG;