3
4
Fork
You've already forked validns
5

feat: support two-argument $INCLUDE per RFC 1035 §5.1 #127

Merged
jelu merged 2 commits from tobez/validns:feat-include-two-arg-form into main 2026年05月18日 11:47:46 +02:00
Collaborator
Copy link

validns rejected the optional argument of $INCLUDE with "garbage after valid $INCLUDE directive", even though RFC 1035 §5.1 specifies $INCLUDE <file-name> [<domain-name>] [<comment>].

process_directive now parses the optional domain-name with extract_name() so a relative name is qualified against the current origin at the $INCLUDE point, then overrides $ORIGIN for the included file by setting file_info->current_origin on the just-pushed file_info. The parent's current_origin is untouched, so the override reverts naturally when the included file ends. Man-page corrected to no longer claim $INCLUDE is missing support.

Fixes #122

validns rejected the optional <domain-name> argument of $INCLUDE with "garbage after valid $INCLUDE directive", even though RFC 1035 §5.1 specifies `$INCLUDE <file-name> [<domain-name>] [<comment>]`. process_directive now parses the optional domain-name with extract_name() so a relative name is qualified against the current origin at the $INCLUDE point, then overrides $ORIGIN for the included file by setting file_info->current_origin on the just-pushed file_info. The parent's current_origin is untouched, so the override reverts naturally when the included file ends. Man-page corrected to no longer claim $INCLUDE is missing <domain-name> support. Fixes #122
feat: support two-argument $INCLUDE per RFC 1035 §5.1
Some checks failed
test / centos (pull_request) Failing after 0s
test / scan-build (pull_request) Failing after 0s
test / debian (pull_request) Failing after 0s
test / ubuntu (pull_request) Failing after 0s
builds.sr.ht/freebsd Job completed
builds.sr.ht/openbsd Job completed
d944f4659d
Owner
Copy link

(削除) Why error out on comment instead of just ignoring it and supporting $INCLUDE fully? (削除ここまで)

My bad

~~Why error out on comment instead of just ignoring it and supporting `$INCLUDE` fully?~~ My bad
fix: remove $INCLUDE from man-page since it now follows RFC 1035 5.1. fully
All checks were successful
builds.sr.ht/freebsd Job completed
builds.sr.ht/openbsd Job completed
test / debian (pull_request) Successful in 46s
test / ubuntu (pull_request) Successful in 47s
test / centos (pull_request) Successful in 1m3s
test / scan-build (pull_request) Successful in 1m16s
8c9e31e20b
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DNS-OARC/validns!127
Reference in a new issue
DNS-OARC/validns
No description provided.
Delete branch "tobez/validns:feat-include-two-arg-form"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?