mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-21 11:13:30 +00:00
effcb5eca3
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) |
||
---|---|---|
.. | ||
compat | ||
csu | ||
libalias | ||
libatm | ||
libbind | ||
libbz2 | ||
libc | ||
libc_r | ||
libcalendar | ||
libcam | ||
libcom_err | ||
libcompat | ||
libcrypt | ||
libdevinfo | ||
libdevstat | ||
libdisk | ||
libedit | ||
libexpat | ||
libfetch | ||
libform | ||
libftpio | ||
libgeom | ||
libio | ||
libipsec | ||
libipx | ||
libisc | ||
libkse | ||
libkvm | ||
libmd | ||
libmenu | ||
libmilter | ||
libmp | ||
libncp | ||
libncurses | ||
libnetgraph | ||
libopie | ||
libpam | ||
libpanel | ||
libpcap | ||
libpthread | ||
libradius | ||
librpcsvc | ||
libsbuf | ||
libsm | ||
libsmb | ||
libsmdb | ||
libsmutil | ||
libstand | ||
libtacplus | ||
libtelnet | ||
libthr | ||
libufs | ||
libugidfw | ||
libusbhid | ||
libutil | ||
libvgl | ||
libwrap | ||
libxpg4 | ||
liby | ||
libypclnt | ||
libz | ||
msun | ||
ncurses | ||
Makefile | ||
Makefile.inc |