[libvirt] [PATCH] syntax-check: prohibit all new uses of gethostby* functions
Daniel Veillard
veillard at redhat.com
Thu Dec 11 14:19:29 UTC 2008
On Thu, Dec 11, 2008 at 11:55:08AM +0100, Jim Meyering wrote:
> "Daniel P. Berrange" <berrange at redhat.com> wrote:
> > On Wed, Dec 10, 2008 at 07:33:17PM -0800, David Lutterkort wrote:
> >> The attached patch makes virConnectGetHostname try a little harder to get a
> >> FQDN on systems where gethostname only returns a short name without a
> >> domain (which is pretty useless). The behavior is equivalent to 'hostname
> >> --fqdn'.
[...]
> > Actually, gethostbyname should never be used in any modern code as it is
> > not thread safe. Instead use getaddrinfo() and the AI_CANONNAME flag
>
> Good point.
> Yet another reason not to use gethostbyname.
> I think it's time to make the prohibition official.
> Here's a patch to do that:
+1 to both patches,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel at veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
More information about the libvir-list
mailing list