nsd+CRLF = confusing error messages

Hi,

I think it would be better if nsd accepts CRLF as well as LF as line ending.

Not because it's such a great idea to use Windows, but because at present the error messages are a little misleading.

zonec: reading zone "beispiel.de".
primary/db.beispiel.de:1: error: invalid TTL value: 86400
primary/db.beispiel.de:7: error: syntax error
primary/db.beispiel.de:11: error: RR before SOA skipped
primary/db.beispiel.de:13: error: RR before SOA skipped
'rimary/db.beispiel.de:13: error: invalid IPv4 address '212.125.101.195
'rimary/db.beispiel.de:19: error: invalid IPv4 address '212.125.101.194
'rimary/db.beispiel.de:20: error: invalid IPv4 address '212.125.101.195
zonec: processed 0 RRs in "beispiel.de".

I suspect it's easier to accept CRLF than to generate a less misleading error message :wink:

Arnt

[On 27 Mar, @19:58, Arnt Gulbrandsen wrote in "nsd+CRLF = confusing error mes ..."]

Hi,

I think it would be better if nsd accepts CRLF as well as LF as line ending.

Not because it's such a great idea to use Windows, but because at
present the error messages are a little misleading.

zonec: reading zone "beispiel.de".
primary/db.beispiel.de:1: error: invalid TTL value: 86400
primary/db.beispiel.de:7: error: syntax error
primary/db.beispiel.de:11: error: RR before SOA skipped
primary/db.beispiel.de:13: error: RR before SOA skipped
zonec: processed 0 RRs in "beispiel.de".

I suspect it's easier to accept CRLF than to generate a less misleading
error message :wink:

I have no access to windows (at least no to one where I can develop
and compile), but this change should be as easy as changing the
following:

zlexer.lex, line 75:
NEWLINE \n

into:
NEWLINE \n|\r

does that work for you?

Miek Gieben writes:

I have no access to windows (at least no to one where I can develop and compile), but this change should be as easy as changing the following:

zlexer.lex, line 75:
NEWLINE \n

into:
NEWLINE \n|\r

does that work for you?

Luckily, I don't have access to Windows box either :wink: But I could test.

That's not quite sufficient. But I looked at the nearby lines, and found that this patch is enough:

--- nsd-2.3.3-orig/zlexer.lex 2005-05-12 14:55:38.000000000 +0200
+++ nsd-2.3.3/zlexer.lex 2006-03-28 19:07:27.585419750 +0200
@@ -72,8 +72,8 @@

  SPACE [ \t]
  LETTER [a-zA-Z]
-NEWLINE \n
-ZONESTR [^ \t\n();.\"\$]
+NEWLINE [\n\r]
+ZONESTR [^ \t\r\n();.\"\$]
  DOLLAR \$
  COMMENT ;
  DOT \.

Still a lot simpler than rejecting with a good error message :wink: Thank you for your speedy response.

Arnt

[On 28 Mar, @19:09, Arnt Gulbrandsen wrote in "Re: nsd+CRLF = confusing error ..."]

--- nsd-2.3.3-orig/zlexer.lex 2005-05-12 14:55:38.000000000 +0200
+++ nsd-2.3.3/zlexer.lex 2006-03-28 19:07:27.585419750 +0200
@@ -72,8 +72,8 @@

SPACE [ \t]
LETTER [a-zA-Z]
-NEWLINE \n
-ZONESTR [^ \t\n();.\"\$]
+NEWLINE [\n\r]
+ZONESTR [^ \t\r\n();.\"\$]
DOLLAR \$
COMMENT ;
DOT \.

Still a lot simpler than rejecting with a good error message :wink: Thank

indeed :slight_smile: I'll apply this to our tree,