Commit Graph

72 Commits

Author SHA1 Message Date
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
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.
2007-05-28 12:06:17 +00:00
christos 7d2ef9d984 From Anon Ymous:
Convert "(void)&" constructs to "volatile".
Check gid against (gid_t)-1 rather than >= 0; gid_t is unsigned.
Flag some parameters __unused so this will compile with -Werror.
2006-12-18 15:14:42 +00:00
mrg 4bc6feceb6 end the argument list to exec*(3) with a NULL instead of a bare '0', as
the latter isn't a pointer context in these varargs functions.
2006-05-11 00:22:52 +00:00
christos 22983123c5 Coverity CID 2341, 2342: Plug memory leak. 2006-03-18 09:46:35 +00:00
mycroft 0428b497d9 Patch from Olaf Siebert in PR 12688 to handle hard links correctly when
renaming.
2004-08-06 15:50:02 +00:00
ginsbach 2841b77712 Append only '@host' to notify email addresses when the destination
host is of the format 'login@host'.  Fixes PR 14412; reviewed by
<christos>.
2004-08-04 02:05:28 +00:00
wiz 5e4aaf0ef0 Sync usage with man page (add [login@], sort options, machine -> host);
print usage to stderr; use getprogname(3).
From Kouichirou Hiratsuka in PR 26225.
2004-07-13 12:06:35 +00:00
wiz 6b6cae1acd Sort options in SYNOPSIS. From Kouichirou Hiratsuka in PR 26225. 2004-07-13 12:02:23 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
fvdl 939c9d99f4 Don't compare a char to NULL. 2003-10-21 02:23:13 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
itojun e97c220e91 use bounded string op 2003-07-23 04:11:12 +00:00
itojun 417386ecc9 strlcpy 2003-07-12 13:38:10 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
simonb 276fd1665c The Double-Semi-Colon Police. 2003-01-20 05:29:53 +00:00
thorpej f393397bd6 Avoid confict with reserved identifier "log". 2002-12-06 03:09:28 +00:00
grant be8ae688ae New sentence, new line. 2002-09-30 11:08:56 +00:00
wiz a9b4ca6205 Remove #if __STDC__. De-__P() and ANSIfy. 2002-06-14 01:18:54 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
ross 8bd7cb6a69 Edit -mdoc usage.
* There is no -indent option to .Bd or .Bl, although you would
  never know that from its frequent use in this tree. There is a
  "-offset indent" combination that makes sense, and you can certainly
  say "-width indent".

* Also, you can't markup the -width option argument, tho you CAN
  use a callable macro. So "-width Ar filename" doesn't make sense,
  but either "-width Ar" or "-width filename" does, as might something
  like "-width xxfilename" for a little extra space.

* There are a lot of needlessly complex hanging tag macros in man4 used
  to create simple item lists. Those should be simplified one of these
  days before someone copies and edits yet another man4 page.
2002-02-07 03:15:06 +00:00
wiz fd16df7001 Sort SEE ALSO, sort sections, punctuation nit. 2001-12-08 19:11:21 +00:00
tron d40605c723 Fix incorrect usage message. Problem noted by Brian Ginsbach in
PR bin/14411.
2001-11-01 16:31:48 +00:00
tron 8370dbf86f Add missing description of option "-D". 2001-11-01 16:30:40 +00:00
wiz 4c99916337 va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00
wiz 251b3464be heirarchy -> hierarchy 2001-08-24 10:24:45 +00:00
lukem c2b84904ae use %ll_ instead of the less standard %q_ 2001-01-04 23:05:54 +00:00
is 135600f947 More format string cleanup by sommerfeld. 2000-10-11 14:46:00 +00:00
matt fcd0fb118f Make gcc 2.96 (and maybe earlier) happier. Include <stdlib.h>,<string.>,
etc. as appropriate to get exit,srncmp,abs,abort,etc.
Add -I${.CURDIR} to a few Makefiles
2000-07-03 02:51:12 +00:00
mrg de9e599c9d apply patches in PR bin/9249: rdist doesn't remove temporary file, from
<Michael.Eriksson@era-t.ericsson.se> to ensure we always remove the tempfile
(broken since mkstemp() was introduced).
2000-06-12 04:43:11 +00:00
mrg c08b0cf381 check some more syscall return values. use mkstemp. 1999-04-20 07:53:02 +00:00
garbled 9e44e9b578 More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages.  Many more to
come.
1999-03-22 18:16:34 +00:00
hubertf 56f2d188fc RCS ID police 1999-02-15 04:54:34 +00:00
mrg 9b99e47cfd ensure buffers for pathnames, etc., are PATH_MAX, etc., long. 1999-01-31 10:02:25 +00:00
christos 7b232cdf19 char -> unsigned char 1998-12-19 20:34:53 +00:00
christos b751ad2c5c de-ja-vous
This thing was still using <sys/dir.h> and struct direct.
Get rid of the time warp.
1998-12-19 20:32:17 +00:00
ross f670fa10c5 Add { and } to shut up egcs. Reformat the more questionable code. 1998-08-25 20:59:36 +00:00
tv 482063559a .y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.
1998-04-09 00:32:31 +00:00
kleink 44ec7efeab Include <time.h>, needed for various definitions. 1998-04-02 10:51:46 +00:00
scottr 91b6282f36 Fix more borken compiler lossage, this time for m68k. 1997-10-24 06:47:31 +00:00
mycroft 004f255040 Use S_IS*(), not S_IF*. 1997-10-19 19:27:40 +00:00
mrg 538e692995 fix compile warnings on the alpha. 1997-10-19 14:50:58 +00:00
mycroft b5d6394251 Output the right file name in an error message.
Also a cosmetic change; pass a null pointer to gettimeofday() for the
time zone info.
1997-10-19 14:34:07 +00:00
mycroft 985cca83b6 Use S_IS*().
Use mode_t, uid_t, and gid_t as appropriate.
Don't use futimes(2) on a directory.
1997-10-19 14:25:24 +00:00
lukem 3b3cf635da WARNSify, fix .Nm usage, deprecate register, s/[br]*/[ms]*/ 1997-10-19 13:58:48 +00:00
mrg 0026c9e93a merge lite-2. 1997-10-18 14:34:39 +00:00
christos 2cb3df576d Pr/4180: Erik Bertelsen: rdist does not produce intelligible error messages
and core dumps when the remote host is down:
	- avoid core dumps by checking lfp before using it.
	- use rcmd's err descriptor to grab and print the message.
1997-10-08 19:16:24 +00:00
christos b1179df85c Don't need -I${.CURDIR} 1997-10-08 19:13:39 +00:00
mrg bf96b282ae rdist is no longer setuid root. 1997-05-26 14:30:47 +00:00
pk b55c3729fe NULL => 0 (Arne Juul; PR#3629) 1997-05-17 20:09:26 +00:00
thorpej 65f3b15dc2 When iterating the host list, do not access memory that has just been
free()'d.  From Matt Beal <beal@umiacs.umd.edu>, PR #2747.
1996-09-10 18:48:57 +00:00