Allow trailing dot in CNAME.

I got reported bug in Fedora [1], that cname is broken in new releases.
At first I though this was false report, but there is still new
regression in cname handling.

Before, it accepted alias with trailing dot. Not it would accept only
target, but not alias.

cname=alias.,target

is no longer valid. The issue is it will count size to skip after
canonicalize. If that ignores trailing dot, next name would be "". And
that is invalid and refused, dnsmasq refuses to start.

I also think that any whitespace like tab should be possible after
comma. So this fixes also 30858e3b9b.
This commit is contained in:
Petr Menšík
2018-03-06 23:13:32 +00:00
committed by Simon Kelley
parent f3223fbff6
commit 56f0623930

View File

@@ -3856,6 +3856,7 @@ err:
while (arg != last)
{
int arglen = strlen(arg);
alias = canonicalise_opt(arg);
if (!alias || !target)
@@ -3871,7 +3872,7 @@ err:
new->target = target;
new->ttl = ttl;
for (arg += strlen(arg)+1; *arg == ' '; arg++);
for (arg += arglen+1; *arg && isspace(*arg); arg++);
}
break;