From owner-freebsd-current@FreeBSD.ORG Wed Dec 10 07:55:55 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7240B1065676 for ; Wed, 10 Dec 2008 07:55:55 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 11E508FC17 for ; Wed, 10 Dec 2008 07:55:54 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender; b=WPP3/1/iT75DUrm9wvOhqA0jr7HtkbHt/+KSSYb4Lpa+VXfLlZEl66trmOeab7F7dmsTzdGhKQ2pYzVIGrzmFtKBO9Qfy5rQgEfVQs9vb3DnnkXQVs9HJTIIYHzwisxWrzdcSc4mz8/MyZCCaPfP41AB+JkJkUBGimE7Vv8B9Wo=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1LAJvE-0000LB-TG; Wed, 10 Dec 2008 10:55:52 +0300 Date: Wed, 10 Dec 2008 10:55:51 +0300 From: Eygene Ryabinkin To: Larry Rosenman Message-ID: References: <004901c95a1c$5c6b2680$15417380$@org> <493ECA0D.7090901@andric.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+W7ryvxEk4RRyt+P" Content-Disposition: inline In-Reply-To: Sender: rea-fbsd@codelabs.ru Cc: Dimitry Andric , freebsd-current@freebsd.org, dougb@freebsd.org Subject: Re: Why does host and dig show a ; as \;? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 07:55:55 -0000 --+W7ryvxEk4RRyt+P Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Larry, good day. Tue, Dec 09, 2008 at 01:49:27PM -0600, Larry Rosenman wrote: > On Tue, 9 Dec 2008, Dimitry Andric wrote: > > On 2008-12-09 17:36, Larry Rosenman wrote: > >> Why does the host command, dig, and a named_db.dump all show a ; as \;= in a > >> TXT record? > > > > AFAICS the semicolon is a comment character in BIND software (at least > > in all config files and so on), and therefore it needs to be escaped. It doesn't need to be escaped inside strings themselves, at least there is no reason to have comments inside strings and BIND itself treats ';' inside strings as ordinary characters. But BIND's internal helper txt_totext does the escaping: ----- lib/dns/rdata.c /* double quote, semi-colon, backslash */ if (*sp =3D=3D 0x22 || *sp =3D=3D 0x3b || *sp =3D=3D 0x5c) { if (tl < 2) return (ISC_R_NOSPACE); *tp++ =3D '\\'; tl--; } ----- And BIND understands both escaped and unescaped semicolons inside strings in zone files -- it treats both of them in a same way. I don't have access to BIND's CVSWeb interface, so I can not trace the origin of semicolon escaping, but I feel that historically BIND treated semicolons inside strings as the plain symbols and this remained so to be backwards-compatible. And escaping in the BIND's output is the stricter form of string formatting. However, for example, our Russian TLD registrars are suggesting to avoid escapes inside strings if it is possible. Don't know why -- it is just a recipe without explanation. I am CC'ing Doug Barton, who maintains BIND for FreeBSD. Doug, is there any requirement for escaping the semicolons inside strings? I am failing to find it in http://www.ietf.org/rfc/rfc1035.txt: it talks about semicolons, but not about escaping and there seems to be no proper BNF notation for DNS zone files. Am I missing something? Thanks! --=20 Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual =20 )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook=20 {_.-``-' {_/ # --+W7ryvxEk4RRyt+P Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkk/dgcACgkQthUKNsbL7YhboQCfcineiqkVrieRI0Mgg5OUCjXc ZGYAnjWmYAujZSBk7ZDj/qMzJV0t0OA9 =UPdy -----END PGP SIGNATURE----- --+W7ryvxEk4RRyt+P--