BIND 10 trac3360, updated. 8b5ded2f871bd67584c67a380c9736baeb9c246d [3360] Fix dbaccess parser to use "persist" value as boolean.
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Mar 25 16:16:13 UTC 2014
The branch, trac3360 has been updated
via 8b5ded2f871bd67584c67a380c9736baeb9c246d (commit)
from 9ed199e32506a1370653a1f9d991cee6c120ab19 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8b5ded2f871bd67584c67a380c9736baeb9c246d
Author: Marcin Siodelski <marcin at isc.org>
Date: Tue Mar 25 17:16:07 2014 +0100
[3360] Fix dbaccess parser to use "persist" value as boolean.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcpsrv/dbaccess_parser.cc | 10 +++++++++-
src/lib/dhcpsrv/tests/dbaccess_parser_unittest.cc | 10 ++++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcpsrv/dbaccess_parser.cc b/src/lib/dhcpsrv/dbaccess_parser.cc
index 743d8a3..afd2c07 100644
--- a/src/lib/dhcpsrv/dbaccess_parser.cc
+++ b/src/lib/dhcpsrv/dbaccess_parser.cc
@@ -58,7 +58,15 @@ DbAccessParser::build(isc::data::ConstElementPtr config_value) {
// 3. Update the copy with the passed keywords.
BOOST_FOREACH(ConfigPair param, config_value->mapValue()) {
- values_copy[param.first] = param.second->stringValue();
+ // The persist parameter is the only boolean parameter at the
+ // moment. It needs special handling.
+ if (param.first != "persist") {
+ values_copy[param.first] = param.second->stringValue();
+
+ } else {
+ values_copy[param.first] = (param.second->boolValue() ?
+ "true" : "false");
+ }
}
// 4. Perform validation checks on the updated set of keyword/values.
diff --git a/src/lib/dhcpsrv/tests/dbaccess_parser_unittest.cc b/src/lib/dhcpsrv/tests/dbaccess_parser_unittest.cc
index a9a3590..555b86b 100644
--- a/src/lib/dhcpsrv/tests/dbaccess_parser_unittest.cc
+++ b/src/lib/dhcpsrv/tests/dbaccess_parser_unittest.cc
@@ -87,8 +87,14 @@ public:
}
// Add the keyword and value - make sure that they are quoted.
- result += quote + keyval[i] + quote + colon + space +
- quote + keyval[i + 1] + quote;
+ // The only parameter which is not quoted is persist as it
+ // is a boolean value.
+ result += quote + keyval[i] + quote + colon + space;
+ if (keyval[i] != "persist") {
+ result += quote + keyval[i + 1] + quote;
+ } else {
+ result += keyval[i + 1];
+ }
}
// Add the terminating brace
More information about the bind10-changes
mailing list