ITS#5571 prevent Adds from displacing {0}config

This commit is contained in:
Howard Chu 2008-06-29 22:48:40 +00:00
parent b716280345
commit a5d0e36798

View 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;
}