Detect when resource is configured more than once.

MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2010-12-26 19:08:41 +00:00
parent 66db33a13b
commit a7130d73a6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216722

View File

@ -535,6 +535,16 @@ resource_statement: RESOURCE resource_start OB resource_entries CB
resource_start: STR
{
/* Check if there is no duplicate entry. */
TAILQ_FOREACH(curres, &lconfig->hc_resources, hr_next) {
if (strcmp(curres->hr_name, $1) == 0) {
pjdlog_error("Resource %s configured more than once.",
curres->hr_name);
free($1);
return (1);
}
}
/*
* Clear those, so we can tell if they were set at
* resource-level or not.