]> git.sur5r.net Git - openldap/commitdiff
ITS#5571 prevent Adds from displacing {0}config
authorHoward Chu <hyc@openldap.org>
Sun, 29 Jun 2008 22:48:40 +0000 (22:48 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 29 Jun 2008 22:48:40 +0000 (22:48 +0000)
servers/slapd/bconfig.c

index de01d5b3c82a59db36e5fedf112d3cfc00739ab8..b7334eb16c86692cc57b57709f95f871c6f9dae1 100644 (file)
@@ -3992,6 +3992,11 @@ cfAddDatabase( CfEntryInfo *p, Entry *e, struct config_args_s *ca )
        if ( p->ce_type != Cft_Global ) {
                return LDAP_CONSTRAINT_VIOLATION;
        }
+       /* config must be {0}, nothing else allowed */
+       if ( !strncmp( e->e_nname.bv_val, "olcDatabase={0}", STRLENOF("olcDatabase={0}")) &&
+               strcmp( e->e_nname.bv_val + STRLENOF("olcDatabase={0}"), "config" )) {
+               return LDAP_CONSTRAINT_VIOLATION;
+       }
        ca->be = frontendDB;    /* just to get past check_vals */
        return LDAP_SUCCESS;
 }