2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[1627] Check for empty origin and file in config, and throw with more relevant error msg

This commit is contained in:
Mukund Sivaraman
2012-03-27 12:33:38 +05:30
parent ae9eae2905
commit c80eae98a8

View File

@@ -155,11 +155,13 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) {
BOOST_FOREACH(ConstElementPtr zone_config, zones_config->listValue()) {
ConstElementPtr origin = zone_config->get("origin");
if (!origin) {
const string origin_txt = origin ? origin->stringValue() : "";
if (origin_txt.empty()) {
isc_throw(AuthConfigError, "Missing zone origin");
}
ConstElementPtr file = zone_config->get("file");
if (!file) {
const string file_txt = file ? file->stringValue() : "";
if (file_txt.empty()) {
isc_throw(AuthConfigError, "Missing zone file for zone: "
<< origin->str());
}