Package: nsd3
Severity: normal
Tags: upstream patch
RFC 1035 states that an $INCLUDE directive is as follows (page 33)
$INCLUDE <file-name> [<domain-name>] [<comment>]
where <domain-name> is stated as follows (bottom of page 33)
.... Domain names which do not end in a dot are called relative; the
actual domain is the concatenation of the relative part with an origin
specified in a $ORIGIN, $INCLUDE, or as an argument to the master file
loading routine.
nsd doesn't use the domain-name attached to an $INCLUDE directive as a
possible relative domain, and assumes it is absolute. The patch attached
checks whether a dot (.) is present, and appends the origin if
nessessary.
The patch should also apply cleanly upstream.
-- System Information:
Debian Release: 6.0
APT prefers stable
APT policy: (950, 'stable'), (850, 'stable-updates'), (50, 'testing'), (25,
'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- Begin Message ---
---
zlexer.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/zlexer.c b/zlexer.c
index 4c69bd1..c326ff2 100644
--- a/zlexer.c
+++ b/zlexer.c
@@ -971,6 +971,11 @@ YY_RULE_SETUP
strip_string(yytext);
dname = dname_parse(parser->region, tmp + 1);
+ if (dname && *(tmp + strlen(tmp + 1)) != '.') {
+ dname = dname_concatenate(parser->region,
+ dname,
+ domain_dname(origin));
+ }
if (!dname) {
zc_error("incorrect include origin '%s'",
tmp + 1);
--
--- End Message ---