Bug 4256 - MAXHOSTNAMELEN issue in Xtranssock.c
Summary: MAXHOSTNAMELEN issue in Xtranssock.c
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/xtrans (show other bugs)
Version: git
Hardware: x86 (IA32) other
: high normal
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-26 05:43 UTC by Michael Banck
Modified: 2005-10-01 21:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
xtrans_maxhostnamelen.diff (355 bytes, patch)
2005-08-26 05:45 UTC, Michael Banck
no flags Details | Splinter Review

Description Michael Banck 2005-08-26 05:43:39 UTC
Xtranssock.c contains an unguarded use of MAXHOSTNAMELEN, making the build fail
on system which does not have a hostname limit, like GNU/Hurd in this case:

gcc -c -ansi -pedantic -Wall -Wpointer-arith -Wstrict-prototypes               
          -Wmissing-prototypes -Wmissing-declarations                    
-Wredundant-decls -Wnested-externs -Wundef    -I../.. -I../../exports/include  
-D__i386__ -D_POSIX_C_SOURCE=199309L                          -D_POSIX_SOURCE
-D_XOPEN_SOURCE                               -D_BSD_SOURCE -D_SVID_SOURCE 
-DFUNCPROTO=15 -DNARROWPROTO -DXTHREADS  -D_REENTRANT -DXUSE_MTSAFE_API   
-DMALLOC_0_RETURNS_NULL  -DHAS_SNPRINTF -DLIBX11                   
-DPOSTLOCALELIBDIR=\"lib\"      -O2 -fno-strict-aliasing -g -I../../lib/xtrans
-DUNIXCONN -DTCPCONN -DHAS_STICKY_DIR_BIT -DHAS_FCHOWN -DIPv6 -DBSD44SOCKETS
-DX11_t -DTRANS_CLIENT -DFAIL_HARD  x11trans.c -o unshared/x11trans.o
In file included from x11trans.c:80:
../../lib/xtrans/Xtranssock.c:1378: error: 'MAXHOSTNAMELEN' undeclared here (not
in a function)
make[3]: *** [x11trans.o] Error 1
Comment 1 Michael Banck 2005-08-26 05:45:48 UTC
Created attachment 3046 [details] [review]
xtrans_maxhostnamelen.diff

Proposed patch.  #define MAXHOSTNAMELEN to 255 if undefined.
Comment 2 Alan Coopersmith 2005-10-02 14:09:53 UTC
Fix committed to CVS head for 6.9/7.0 RC1 releases.   Thanks for the patch!

CVSROOT:	/cvs/xorg
Module name:	xc
Changes by:	alanc@gabe.freedesktop.org	05/10/02 14:01:35

Log message:
  2005-10-02  Alan Coopersmith  <alan.coopersmith@sun.com>
  
  	* lib/xtrans/Xtransock.c
  	Bug #4256 <https://bugs.freedesktop.org/show_bug.cgi?id=4256>
  	Patch #3046 <https://bugs.freedesktop.org/attachment.cgi?id=3046>
  	Define MAXHOSTNAMELEN if platform doesn't (Michael Banck)

Modified files:
      xc/lib/xtrans/:
        Xtranssock.c 
      ./:
        ChangeLog 
  
  Revision      Changes    Path
  1.9           +4 -0      xc/lib/xtrans/Xtranssock.c
  http://cvs.freedesktop.org/xorg/xc/lib/xtrans/Xtranssock.c
  1.1366        +7 -0      xc/ChangeLog
  http://cvs.freedesktop.org/xorg/xc/ChangeLog


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.