freebsd-skq/lib
Garrett Wollman effcb5eca3 Change gethostname() to set errno to ENAMETOOLONG instead of ENOMEM
when the buffer is not long enough to hold the current host name.
POSIX does not standardize error returns for gethostname(), so it
doesn't matter which one we use, but ENAMETOOLONG is at least a little
more intuitive, and mi suggests the existence of prior art.  I've been
running with this change for a while on my home machine with no
effect.  At the same time, I've updated the prototype for
gethostname() to use the correct standard type (size_t) for the
namelen argument.

All of the in-tree callers fall into one of the following categories:
1) Call perror() or equivalent when gethostname() fails.
2) Ignore gethostname()'s return value entirely, potentially resulting
in data corruption if the buffer is too small.
3) Fall back to a (possibly sensible) default value if gethostname()
fails.

Many of the callers I examined shows signs of confusion about the
correct sizing of the host name buffer.  gethostname(3) now has more
information about this, as well as updated standards information.

PR:		48114
Submitted by:	mi (in part)
2003-08-19 20:38:44 +00:00
..
compat Add libgmp.so.3 from 4.7-RELEASE CDs. 2003-02-17 17:26:03 +00:00
csu Fix typo: Passing the first argument to exit() in out2 does not work. 2003-07-15 03:50:38 +00:00
libalias style.Makefile(5) 2003-08-18 15:25:39 +00:00
libatm style.Makefile(5) 2003-08-18 15:25:39 +00:00
libbind Removed now unused INTERNALSTATICLIB. 2002-05-13 11:09:07 +00:00
libbz2 Remove MAINTAINER lines. 2003-06-14 19:32:52 +00:00
libc Change gethostname() to set errno to ENAMETOOLONG instead of ENOMEM 2003-08-19 20:38:44 +00:00
libc_r Add wrapper for kqueue() to keep track of the allocated fd and allow it to 2003-07-25 17:02:33 +00:00
libcalendar
libcam Stage 3 of dynamic root support. Make all the libraries needed to run 2003-08-17 08:28:46 +00:00
libcom_err
libcompat Axe AINC. 2003-07-01 15:07:01 +00:00
libcrypt Stage 3 of dynamic root support. Make all the libraries needed to run 2003-08-17 08:28:46 +00:00
libdevinfo Expand length of pnpinfo and length fields since pccard pnpinfo can 2003-02-17 18:56:00 +00:00
libdevstat style.Makefile(5) 2003-08-18 15:25:39 +00:00
libdisk Sanity check the list obtained from the kern.disks sysctl so that Disk_Names() 2003-06-07 20:02:56 +00:00
libedit style.Makefile(5) 2003-08-18 15:25:39 +00:00
libexpat Stage 3 of dynamic root support. Make all the libraries needed to run 2003-08-17 08:28:46 +00:00
libfetch Some servers respond to RETR in active mode with 125 (connection already 2003-08-19 11:43:11 +00:00
libform Use 2003-06-06 13:46:55 +00:00
libftpio The .Fn function 2003-06-08 10:34:00 +00:00
libgeom style.Makefile(5) 2003-08-18 15:25:39 +00:00
libio
libipsec style.Makefile(5) 2003-08-18 15:25:39 +00:00
libipx style.Makefile(5) 2003-08-18 15:25:39 +00:00
libisc Fix the #include part of the SYNOPSIS for heap.3 2003-06-17 08:43:19 +00:00
libkse Support printing 64 bits pointer and long integer. 2003-08-19 08:29:33 +00:00
libkvm style.Makefile(5) 2003-08-18 15:25:39 +00:00
libmd style.Makefile(5) 2003-08-18 15:25:39 +00:00
libmenu Use 2003-06-06 13:46:55 +00:00
libmilter Remove MAINTAINER= lines from individual Makefiles in favor of the 2003-07-07 03:54:04 +00:00
libmp Adjust for OpenSSL 0.9.7. 2003-01-28 23:03:15 +00:00
libncp Fix for 64 bit platforms. sysctl's length args are pointers to 2003-07-25 19:17:46 +00:00
libncurses style.Makefile(5) 2003-08-18 15:25:39 +00:00
libnetgraph The .Fn function 2003-06-08 10:34:00 +00:00
libopie Drop login.c and logwtmp.c from the library build. None of the apps 2002-10-04 00:24:31 +00:00
libpam Revert previous commit after fixing libpam. 2003-07-21 19:56:28 +00:00
libpanel Use 2003-06-06 13:46:55 +00:00
libpcap Zap now-unused SHLIB_MINOR 2002-09-28 00:25:32 +00:00
libpthread Support printing 64 bits pointer and long integer. 2003-08-19 08:29:33 +00:00
libradius Add IPv6 related attributes defined in RFC3162. 2003-06-18 17:29:15 +00:00
librpcsvc make rstat(3) return an 'enum clnt_stat' rather than an 'int' to match 2002-10-01 22:02:06 +00:00
libsbuf style.Makefile(5) 2003-08-18 15:25:39 +00:00
libsm Remove MAINTAINER= lines from individual Makefiles in favor of the 2003-07-07 03:54:04 +00:00
libsmb Zap now-unused SHLIB_MINOR 2002-09-28 00:25:32 +00:00
libsmdb Remove MAINTAINER= lines from individual Makefiles in favor of the 2003-07-07 03:54:04 +00:00
libsmutil Remove MAINTAINER= lines from individual Makefiles in favor of the 2003-07-07 03:54:04 +00:00
libstand bsd.lib.mk,v 1.143 no longer uses ld(1) directly to strip 2003-06-30 19:08:49 +00:00
libtacplus mdoc(7) police: formatting nits. 2002-11-29 15:57:50 +00:00
libtelnet Make sure that a "make release" (more accurately the bit that makes 2003-07-24 17:19:15 +00:00
libthr Implement _get_curthread and _set_curthread. We use GCCs builtin 2003-07-24 07:51:49 +00:00
libufs style.Makefile(5) 2003-08-18 15:25:39 +00:00
libugidfw Assorted mdoc(7) fixes. 2003-06-01 19:41:49 +00:00
libusbhid Assorted mdoc(7) fixes. 2003-05-22 13:02:28 +00:00
libutil style.Makefile(5) 2003-08-18 15:25:39 +00:00
libvgl Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup, 2003-01-01 18:49:04 +00:00
libwrap Turn on the extended syntax, which TCP_wrappers has by default, as 2003-07-24 19:58:56 +00:00
libxpg4 Mark libxpg4 as OBSOLETE_IN_6: it has been empty since its contents 2003-06-13 07:21:37 +00:00
liby Zap now-unused SHLIB_MINOR 2002-09-28 00:25:32 +00:00
libypclnt Fix the master yppasswd routines, so they really work 2003-06-15 10:36:53 +00:00
libz Stage 3 of dynamic root support. Make all the libraries needed to run 2003-08-17 08:28:46 +00:00
msun Stage 3 of dynamic root support. Make all the libraries needed to run 2003-08-17 08:28:46 +00:00
ncurses style.Makefile(5) 2003-08-18 15:25:39 +00:00
Makefile Imply NOLIBC_R for PowerPC. 2003-08-16 21:21:07 +00:00
Makefile.inc Zap now-unused SHLIB_MINOR 2002-09-28 00:25:32 +00:00