Repository navigation
zone_record: PUT checks the rdata it changes - #95
Merged
Merged
Conversation
Contributor
Author
|
The ubuntu test and coverage jobs fail at |
Contributor
|
PUT only checked the merged record when the type or a packed field changed, so an A record took address 1.2.3. A PUT carrying any rdata field now runs the same check as create() on the merged record. A PUT without one, such as a ttl edit, is not checked. A record that fails the check, such as one from v2 or an earlier PUT, still takes a ttl-only edit. Any PUT carrying its rdata, a whole record sent back included, is refused unless it leaves the record valid. json and toml create() skip the check, and PUT writes an owner without it, so both can still store such a record. checkRecord required an address of every type without a column map, such as RRSIG and SIG. json and toml store those types, so the wider check would have refused every rdata edit to them. It now requires a main field only of a type that has one. mysql has no columns for those types, and refuses them by name. The check replaced the owner with a placeholder, so an RRSIG signed by its own owner failed. An absolute owner is now checked as given, as create() does. The mysql store dropped an SRV priority of 0 when reading, so a valid SRV read back invalid and every rdata edit to it would be refused. It now keeps that 0, as json and toml do.
The schema takes the covered type as text, so the test sends 'A' and the times as stamps. The test then passes before and after dns-resource-record maps RRSIG into mysql's columns.
aberoham
force-pushed
the
zr-put-rdata
branch
from
November 16, 2026 17:36
dc1b487 to
3018bd3
Compare
The web UI sends every rdata field on every save, so a TTL edit to a record stored invalid was refused. A field sent back as stored is no longer a change. One helper names a type's main field for checkRecord and mysql. The RRSIG and NAPTR checks are now unit tests of checkPut, so every store runs them.
aberoham
force-pushed
the
zr-put-rdata
branch
from
November 16, 2026 17:41
3018bd3 to
a2b3b9f
Compare
json and toml store a relative owner as given, and v2 rows on mysql hold one too. The PUT check put the placeholder in its place. An RRSIG owned by www in example.com then failed its labels and signer checks on any signature edit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PUT /zone_record checked the merged record only when the type changed, or a field packed into a shared column (#77). Any other rdata edit went straight to the store, so an A record took
1.2.3:A PUT that changes any rdata field now runs the same check as create() on the merged record. That PUT answers 400. A field sent back as stored is not a change, so a TTL edit from the web UI isn't checked.
The wider check met two older faults in
checkRecord. It required anaddressof types that have none, such as RRSIG and SIG. json and toml store those types. The wider check would refuse every rdata edit to them. A main field is now required only of a type that has one. mysql has no columns for those types, and now refuses them by name rather than for a missing address.It also checked a placeholder owner in place of the record's own. An RRSIG signed by its owner therefore failed. An absolute owner is now checked as given, as create() on mysql already does. A relative owner is checked under its zone.
The mysql store also dropped an SRV priority of 0 on read. A valid SRV then read back invalid. The wider check would refuse its rdata edits. It now keeps the 0, as json and toml do. GET of such a record on mysql now includes
priority: 0.Concurrent PUTs to different rdata columns of one record are each checked against the record as read, on mysql.