2N/A * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A * Workarounds for known system software bugs. This module provides wrappers 2N/A * around library functions and system calls that are known to have problems 2N/A * on some systems. Most of these workarounds won't do any harm on regular 2N/A * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. 2N/A * Some AIX versions advertise a too small MAXHOSTNAMELEN value (32). 2N/A * Result: long hostnames would be truncated, and connections would be 2N/A * dropped because of host name verification failures. Adrian van Bloois 2N/A * (A.vanBloois@info.nic.surfnet.nl) figured out what was the problem. 2N/A * You have this problem when the compiler complains about illegal lvalues 2N/A * or something like that. The following code fixes this mutant behaviour. 2N/A * It should not be enabled on "normal" systems. 2N/A * Bug reported by ben@piglet.cr.usgs.gov (Rev. Ben A. Mesander). 2N/A#
endif /* INET_ADDR_BUG */ 2N/A * With some System-V versions, the fgets() library function does not 2N/A * account for partial reads from e.g. sockets. The result is that fgets() 2N/A * gives up too soon, causing username lookups to fail. Problem first 2N/A * reported for IRIX 4.0.5, by Steve Kotsopoulos <steve@ecf.toronto.edu>. 2N/A * The following code works around the problem. It does no harm on "normal" 2N/A * Copy until the buffer fills up, until EOF, or until a newline is 2N/A * Return 0 if nothing was read. This is correct even when a silly buffer 2N/A * length was specified. 2N/A#
endif /* BROKEN_FGETS */ 2N/A * With early SunOS 5 versions, recvfrom() does not completely fill in the 2N/A * source address structure when doing a non-destructive read. The following 2N/A * code works around the problem. It does no harm on "normal" systems. 2N/A /* Assume that both ends of a socket belong to the same address family. */ 2N/A#
endif /* RECVFROM_BUG */ 2N/A * The Apollo SR10.3 and some SYSV4 getpeername(2) versions do not return an 2N/A * error in case of a datagram-oriented socket. Instead, they claim that all 2N/A * UDP requests come from address 0.0.0.0. The following code works around 2N/A * the problem. It does no harm on "normal" systems. 2N/A#
endif /* GETPEERNAME_BUG */ 2N/A * According to Karl Vogel (vogelke@c-17igp.wpafb.af.mil) some Pyramid 2N/A * versions have no yp_default_domain() function. We use getdomainname() 2N/A#
endif /* USE_GETDOMAIN */ 2N/A * Solaris 2.4 gethostbyname() has problems with multihomed hosts. When 2N/A * doing DNS through NIS, only one host address ends up in the address list. 2N/A * All other addresses end up in the hostname alias list, interspersed with 2N/A * copies of the official host name. This would wreak havoc with tcpd's 2N/A * hostname double checks. Below is a workaround that should do no harm when 2N/A * accidentally left in. A side effect of the workaround is that address 2N/A * list members are no longer properly aligned for structure access. 2N/A#
endif /* SOLARIS_24_GETHOSTBYNAME_BUG */ 2N/A * Horror! Some FreeBSD 2.0 libc routines call strtok(). Since tcpd depends 2N/A * heavily on strtok(), strange things may happen. Workaround: use our 2N/A * private strtok(). This has been fixed in the meantime. 2N/A#
endif /* USE_STRSEP */ 2N/A * IRIX 5.3 (and possibly earlier versions, too) library routines call the 2N/A * non-reentrant strtok() library routine, causing hosts to slip through 2N/A * allow/deny filters. Workaround: don't rely on the vendor and use our own 2N/A * strtok() function. FreeBSD 2.0 has a similar problem (fixed in 2.0.5). 2N/A * Skip over separator characters and detect end of string. 2N/A * Skip over non-separator characters and terminate result. 2N/A#
endif /* LIBC_CALLS_STRTOK */