BIND 10 #2895: delete record from DB datasrc should use actual column values for rdata
BIND 10 Development
do-not-reply at isc.org
Mon Apr 1 16:25:54 UTC 2013
#2895: delete record from DB datasrc should use actual column values for rdata
-------------------------------------+-------------------------------------
Reporter: | Owner:
jinmei | Status: new
Type: | Milestone: Next-Sprint-
defect | Proposed
Priority: | Keywords:
medium | Sensitive: 0
Component: data | Sub-Project: DNS
source | Estimated Difficulty: 0
CVSS Scoring: | Total Hours: 0
Defect Severity: N/A |
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
In `DatabaseUpdater::deleteRRset()`, we pass the underlying datasrc
accessor textual form of each RDATA to be deleted. The textual RDATA
is converted from the `RRset` object passed to `deleteRRset()`.
I'm afraid this is fragile, because some RDATA can be case insensitive
in their textual representation while some others cannot, and so the
text would be compared in case-sensitive manner at the DB layer (which
is the case of our SQLite3 schema and implementation). So, for
example, if an NS RDATA is stored in the DB as "NS.EXAMPLE.COM." and
we try to delete it via `deleteRRset()` specifying it as
"ns.example.com.", this wouldn't work (and it actually doesn't for our
SQLite3 data source).
(Note: theoretically, it could happen for other columns (e.g. a single
domain name can have several different representations), but I suspect
it's much less likely to happen in practice for other fields.)
So I propose revising `deleteRRset()` as follows:
- For each RDATA to be deleted, it first gets the underlying textual
representation in the DB using `DatabaseAccessor::getRecords()`
- Then call `DatabaseAccessor::deleteRecordInZone()` with the string
retrieved in the first step
- We should probably report it as an exception if not all specified
RDATA are found in the DB in the first step.
--
Ticket URL: <http://bind10.isc.org/ticket/2895>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list