From owner-freebsd-hackers Mon Dec 10 2:41:55 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from straylight.ringlet.net (sentinel.office1.bg [217.75.134.126]) by hub.freebsd.org (Postfix) with SMTP id C2DF437B417 for ; Mon, 10 Dec 2001 02:41:45 -0800 (PST) Received: (qmail 14527 invoked by uid 1000); 10 Dec 2001 10:40:49 -0000 Date: Mon, 10 Dec 2001 12:40:49 +0200 From: Peter Pentchev To: Terry Lambert Cc: Dima Dorfman , chris@FreeBSD.ORG, Igor M Podlesny , freebsd-hackers@FreeBSD.ORG Subject: Re: jail.c.patch (allowing to use hostnames when invoking jail(8)) Message-ID: <20011210124049.G757@straylight.oblivion.bg> Mail-Followup-To: Terry Lambert , Dima Dorfman , chris@FreeBSD.ORG, Igor M Podlesny , freebsd-hackers@FreeBSD.ORG References: <20011209205442.C8D0A3E2F@bazooka.trit.org> <3C141F9E.D7681BCC@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C141F9E.D7681BCC@mindspring.com>; from tlambert2@mindspring.com on Sun, Dec 09, 2001 at 06:36:14PM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Dec 09, 2001 at 06:36:14PM -0800, Terry Lambert wrote: > Dima Dorfman wrote: > > Here's an updated patch which is a result of comments from a few > > people. The changes are: (a) deconfuse the usage message by not > > naming two arguments as "hostname" (that was sloppiness on my part), > > and (b) remove a redundant inet_aton call (gethostbyname(3) will DTRT > > with an IP address) [1]. > > > > [1] It probably shouldn't, since as others have pointed out to me, > > "1.1.1.1" is a valid DNS name. The correct solution would be to have > > a flag which makes it explicit whether the argument is an IP address > > or DNS name, but few, if any, other programs in the system do this, > > and I don't think this is a good place to start. > > This is why the inte_aton() call is still necessary. [snip] > Please call inet_aton(), and then _only_ if that fails, call the > gethostbyname(). How about inet_pton() and getnameinfo()? G'luck, Peter -- If I had finished this sentence, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message