FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry. RedHat has
evidently built all "core system packages" with this option for some time.
This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.
This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros. Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.
Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default. Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
* Sprinkle const.
* Use EXIT_FAILURE instead of 1.
* Use err(), errx().
* Use calloc() instead of malloc()+memset().
* timedc:
* Non-terminated hostnames or unknown tsp_type could
cause a crash due to out-of-bounds reads in msite().
* Check the received packet size.
* Merged duplicated code into functions.
* Moved variables into the relevant scopes.
* Use connect() so that only the receiver can reply,
send()/recv() can be used and rejected packets
are immediately noticed by recv() instead of causing
timeouts.
* Updated manpage.
use of a raw socket for ICMP; thus there is also no need to differ
between privileged and unprivileged commands.
* Switch to user "nobody" after allocating the raw socket.
* Close all file descriptors above 2 (just in case).
* Check the packet size and sender address in daydiff().
* priv_resources(): Use bind() instead of bindresvport() because an
reserved port is not required. This also resolves the interoperability
issue reported in PR bin/35479.
* Replaced most strlcpy() with set_tsp_name() and get_tsp_name() because
strlcpy() could potentially run out-of-bounds and doesn't zero out
unused buffer space.
* Replaced bcopy/bzero() with memcpy/memset().
* Fixed potential alignment/aliasing issues in measure().
* Replace u_short/u_long with uint16_t/uint32_t/in_addr_t where appropriate.
* Renamed sin to addr because sin is a reserved identifier.
* Use bindresvport() instead of looping over bind(); rresvport() returns
a SOCK_STREAM socket not SOCK_DGRAM.
sync with FreeBSD/OpenBSD
- Add a standard option list and make appropriate changes to the
body of the description.
- Document "-G netgroup".
- Miscellaneous grammar and mdoc fixes.
Some option resorting by yours truly.
program/tool from "FOO" to "TOOL_FOO". The new variables are:
TOOL_ASN1_COMPILE TOOL_CAP_MKDB TOOL_CAT TOOL_CKSUM TOOL_COMPILE_ET
TOOL_CONFIG TOOL_CRUNCHGEN TOOL_CTAGS TOOL_DB TOOL_EQN TOOL_FGEN
TOOL_GENCAT TOOL_GROFF TOOL_HEXDUMP TOOL_INDXBIB TOOL_INSTALLBOOT
TOOL_INSTALL_INFO TOOL_M4 TOOL_MAKEFS TOOL_MAKEINFO TOOL_MAKEWHATIS
TOOL_MDSETIMAGE TOOL_MENUC TOOL_MKCSMAPPER TOOL_MKESDB
TOOL_MKLOCALE TOOL_MKMAGIC TOOL_MKTEMP TOOL_MSGC TOOL_MTREE
TOOL_PAX TOOL_PIC TOOL_PREPMKBOOTIMAGE TOOL_PWD_MKDB TOOL_REFER
TOOL_ROFF_ASCII TOOL_ROFF_DVI TOOL_ROFF_HTML TOOL_ROFF_PS
TOOL_ROFF_RAW TOOL_RPCGEN TOOL_SOELIM TOOL_SUNLABEL TOOL_TBL
TOOL_UUDECODE TOOL_VGRIND TOOL_ZIC
For each, provide default in <bsd.sys.mk> of the form:
TOOL_FOO?= foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
TOOL_FOO= ${TOOLDIR}/bin/${_TOOL_PREFIX}foo
Document all of these in bsd.README.
This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
code considerably and was mainly providing SGI specific logging facilities
and some hacks to improve the relyablility on SGI systems by increasing
priorities etc...