From owner-freebsd-stable@FreeBSD.ORG Thu Oct 27 12:23:48 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1AA8A16A41F for ; Thu, 27 Oct 2005 12:23:48 +0000 (GMT) (envelope-from ptroot@iaces.com) Received: from iaces.com (horton.iaces.com [204.147.87.98]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70F2643D45 for ; Thu, 27 Oct 2005 12:23:47 +0000 (GMT) (envelope-from ptroot@iaces.com) Received: from [204.147.87.125] (borg.iaces.com [204.147.87.125]) (authenticated bits=0) by iaces.com (8.13.4/8.13.3) with ESMTP id j9RCNZ70005684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 Oct 2005 07:23:35 -0500 (CDT) (envelope-from ptroot@iaces.com) Message-ID: <4360C6A7.2080502@iaces.com> Date: Thu, 27 Oct 2005 07:23:03 -0500 From: "Paul T. Root" User-Agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jan Grant References: <200510262307.j9QN7G7V014335@drugs.dv.isc.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Greg Black , Mark Andrews , freebsd-stable@freebsd.org Subject: Re: Resolver doesn't like 1.2.3.04 in /etc/hosts X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2005 12:23:48 -0000 man inet_addr and you'll find: All numbers supplied as ``parts'' in a `.' notation may be decimal, octal, or hexadecimal, as specified in the C language (i.e., a leading 0x or 0X implies hexadecimal; otherwise, a leading 0 implies octal; otherwise, the number is interpreted as decimal). So a leading zero means hex. Stop trying to make it look pretty. Standards are a good thing and need to be followed. Jan Grant wrote: > *********************** > This message has been scanned by the InterScan for CSC-SSM and found to be free of known security risks. > ***********-*********** > > > On Thu, 27 Oct 2005, Mark Andrews wrote: > > >>>On 2005-10-26, Mark Andrews wrote: >>> >>>> Leading zeros are ambigious. Some platforms treat them as octal >>>> others treat them as decimal. >>> >>>There is nothing ambiguous about the example provided. (Perhaps >>>it wasn't a good example, but it's always a bug if '04' is not >>>correctly decoded, regardless of the numeric base in use.) >> >> You want a ambigious example? >> >> 192.168.222.012 > > > It amazed me that no RFC ever appears to have standardised this format > (although it is alluded to in passing as being decimal in various other > places). Eg, 1035 has: > > [[[ > The RDATA section of > an A line in a master file is an Internet address expressed as four > decimal numbers separated by dots without any imbedded spaces (e.g., > "10.2.0.52" or "192.0.5.6"). > ]]] > > (although that's DNS zone file format, not /etc/hosts.) > > >> It's much easier to just reject octal and hexadecimal than >> to work out when and when not it is ambigious. It is also >> better to demand all 4 octets. It also generates less >> support complaints. > > > I'm happy to reject octal and hex too! Anyway, count this as one (minor) > support gripe :-) > > Thanks for your time, > jan > > -- ______ Paul T. Root / _ \ 1977 MGB / /|| \\ ||\/ || _ | || || || \ ||__// \______/