[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH] do not use gethostbyname() for hostname -s
From: Denys Vlasenko <vda.linux () googlemail ! com>
Date: 2013-12-17 18:14:41
Message-ID: 201312171914.41200.vda.linux () googlemail ! com
[Download RAW message or body]
On Monday 09 December 2013 18:56, Michael Tokarev wrote:
> There's no reason to call gethostbyname() on the value returned
> by uname() when asked just for a short name of a host. This may
> also be wrong, when uname is set to one value, but in /etc/hosts
> (or elsewhere) the "canonical" name is different. This is often
> the case for localhost entry in /etc/hosts:
>
> 127.0.0.1 localhost myname
>
> With this content of /etc/hosts, and uname being set to myname,
> busybox hostname -s will return localhost, while regular
> hostname utility returns myname.
>
> Fix this by not calling gethostbyname() for the simple `hostname -s'
> use.
>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Applied, thanks!
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic