Date: Thu, 27 Oct 2005 07:23:03 -0500 From: "Paul T. Root" <ptroot@iaces.com> To: Jan Grant <Jan.Grant@bristol.ac.uk> Cc: Greg Black <gjb@gbch.net>, Mark Andrews <Mark_Andrews@isc.org>, freebsd-stable@freebsd.org Subject: Re: Resolver doesn't like 1.2.3.04 in /etc/hosts Message-ID: <4360C6A7.2080502@iaces.com> In-Reply-To: <Pine.GSO.4.62.0510271304060.10652@mail.ilrt.bris.ac.uk> References: <200510262307.j9QN7G7V014335@drugs.dv.isc.org> <Pine.GSO.4.62.0510271304060.10652@mail.ilrt.bris.ac.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
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 / /|| \\ ||\/ || _ | || || || \ ||__// \______/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4360C6A7.2080502>