Bug 5737 - NI_MAXHOST should be available without -D_GNU_SOURCE defined
Summary: NI_MAXHOST should be available without -D_GNU_SOURCE defined
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P1 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-06 11:49 UTC by Ismail "cartman" Donmez
Modified: 2014-07-02 07:39 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ismail "cartman" Donmez 2008-02-06 11:49:19 UTC
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/resolv/netdb.h.diff?r1=1.47&r2=1.48&cvsroot=glibc&f=h
started to define NI_MAXHOST only if _GNU_SOURCE is defined. 

This is wrong because NI_MAXHOST is also used on BSD systems and this change
breaks lots of applications.
Comment 1 Joshua Daniel Franklin 2008-02-14 21:31:18 UTC
These seem to be defined on at least Tru64 and Solaris, too:

https://www.redhat.com/archives/fedora-devel-list/2008-February/msg01231.html

Perhaps they could just be undefined in strict SUSv3 case, but left defined for
the common case.
Comment 2 Joshua Daniel Franklin 2008-02-14 23:22:17 UTC
Just to follow up, here is a complete list from yesterday's complete Fedora
devel rebuild that failed with "error: 'NI_MAXHOST' undeclared"

alpine-1.00-2.fc9.src.rpm
brltty-3.9-1.1.fc9.src.rpm
curl-7.18.0-1.fc9.src.rpm
cyrus-imapd-2.3.9-8.fc9.src.rpm
cyrus-sasl-2.1.22-11.fc9.src.rpm
ghc-6.8.2-2.fc9.src.rpm
gkrellm-2.3.1-2.fc9.src.rpm
gnet2-2.0.7-10.fc8.src.rpm
irssi-0.8.12-4.fc9.src.rpm
krb5-1.6.3-4.fc9.src.rpm
lash-0.5.3-3.fc8.src.rpm
libevent-1.3e-1.fc9.src.rpm
libident-0.32-1.fc9.src.rpm
lksctp-tools-1.0.7-2.fc8.src.rpm
loudmouth-1.3.3-2.fc9.src.rpm
mail-notification-5.0-2.fc9.src.rpm
nc6-1.0-5.fc8.src.rpm
nfs-utils-lib-1.1.1-1.fc9.src.rpm
openssl-0.9.8g-4.fc9.src.rpm
pioneers-0.11.3-3.fc9.src.rpm
rbldnsd-0.996a-4.fc8.src.rpm
rsh-0.17-45.fc9.src.rpm
ruby-1.8.6.111-7.fc9.src.rpm
slrn-0.9.8.1pl1-7.20070716cvs.fc9.src.rpm
tcp_wrappers-7.6-50.fc8.src.rpm
tcpdump-3.9.8-3.fc9.src.rpm
telepathy-salut-0.2.2-1.fc9.src.rpm
ttcp-1.12-16.fc8.src.rpm
xorg-x11-server-utils-7.3-2.fc9.src.rpm


This will be a lot of patching if NI_MAXHOST is going to stay _GNU_SOURCE .
Comment 3 Roy Marples 2008-02-15 10:52:21 UTC
Would they work if the guard was changed to __USE_BSD?
Comment 4 Ulrich Drepper 2008-02-15 15:50:46 UTC
I changed the header to define the macro when __USE_MISC is defined.