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:
@@ -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user