Commit Graph

65 Commits

Author SHA1 Message Date
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
kre
d4305dc776 sysctl(KERN_BOPOTIME) started returning a struct timespec in 2009.
Update to match....    We're slow but we get there eventually!

NFC for any of these programs, struct timeval and struct timespec
are the same size, and only the tv_sec field of boottime is used,
and that's unchanged.
2018-10-30 21:15:09 +00:00
christos
a226200999 include <pwd.h> 2012-11-04 22:32:01 +00:00
joerg
bec77c5f43 Use __dead 2011-08-31 13:32:36 +00:00
lukem
d877c4c3c0 Enable WARNS=4 by default, except for:
cpuctl  dumplfs  hprop  ipf  iprop-log  kadmin  kcm  kdc  kdigest
	kimpersonate  kstash  ktutil  makefs  ndbootd  ntp  pppd  quot
	racoon  racoonctl  rtadvd  sntp  sup  tcpdchk  tcpdmatch  tcpdump
	traceroute  traceroute6  user  veriexecgen  wsmoused  zic
(Mostly third-party applications)
2009-04-22 15:23:01 +00:00
lukem
e3823f584e Fix -Wsign-compare issue 2009-04-18 13:05:54 +00:00
lukem
9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
dholland
16e3bec279 Clarify how one is supposed to use the pointers returned by getutentries()
(the utmpentry.c code), specifically with respect to who owns them and
when to free them. Now they're owned by utmpentry.c, only. Abolish the
freeutentries() function, which was the wrong abstraction; add instead
endutentries(), which flushes out the internally managed memory.

Update callers as necessary. Some (e.g. talkd) had been leaking memory;
others (e.g. syslogd) had been accidentally freeing and reloading utmp
more often than necessary. There are a couple untidy bits in users and
rwhod that someone should look after sometime, maybe.

Fixes PR bin/35131, which was about talkd's memory leak.
2008-07-13 20:07:48 +00:00
perry
8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
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
mrg
c48f394145 assign to wd.wd_recvtime rather than casting a pointer to it
to a time_t pointer to call time(3).
2006-05-11 08:40:28 +00:00
christos
18b5fc9e5c Off by one in copying stuff to struct whoent. Found by Liam Foy. 2005-10-02 16:49:46 +00:00
wiz
6438e0bfa7 Sync usage with man page. 2005-09-12 18:34:37 +00:00
wiz
4b44cc9527 New sentence, new line.
Add -u to SYNOPSIS. Fix some typos.
Use more markup. Bump date for -u.
2005-09-12 18:33:56 +00:00
tsarna
04414a373b Add -u option: rwhod will drop privledges and become the given user.
reviewed by jwise
2005-09-12 16:13:13 +00:00
wiz
b94cb50cae Fix argument name, and move Pp where it belongs. From YOMURA Masanori in private mail. 2005-09-11 23:45:04 +00:00
christos
ef6897a3a6 Add "by default" (Liam Foy) 2005-08-09 23:27:31 +00:00
christos
cb1d68978b Patch from Liam J. Foy:
- cleanup sendto code.
- fix usage.
2005-07-05 02:46:36 +00:00
peter
e0de99f875 Remove trailing space, fix a Xref. 2005-07-01 16:18:46 +00:00
christos
6b7013d1ad Change g flag to i as in the PR.
Don't allow interval to be set to > 11 minutes.
Rephrase option blurb.
2005-07-01 15:31:18 +00:00
christos
c36c99ef66 PR/30648: Liam J. Foy: rwhod patch to reduce time interval between broadcasts 2005-07-01 13:07:21 +00:00
junyoung
632e7ed58f Remove a unnecessary semicolon and trailing spaces. 2005-06-27 12:07:46 +00:00
peter
c14c7a6bb6 - Use the timer* macros from sys/time.h, no need to invent a new time add
function if it already exists.
- Improve a few function/variable names and use EXIT_FAILURE.
2005-06-24 13:47:30 +00:00
christos
a8b658e375 Initialize events not revents. Noted by Peter Postma. The timer changes he
can make himself :-)
2005-06-24 13:24:23 +00:00
christos
f17eeccada Fixes from Liam J. Foy to use poll, and proper signals. (from OpenBSD)
While there, ansify, and fix const abuse.
2005-06-24 13:22:09 +00:00
dsl
9122339b9f Add (unsigned char) cast to ctype functions 2004-10-30 15:39:39 +00:00
agc
326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
itojun
d9f2774c1e use bounded string op 2003-07-13 12:08:28 +00:00
christos
50455a9139 PR/20318: Johnny Billquist: rwhod does not compile with -DDEBUG 2003-02-12 17:49:35 +00:00
lukem
17d72c8a6b use NETBSDSRCDIR as appropriate 2002-09-18 03:54:26 +00:00
christos
b166b5b47b use utmpx. 2002-08-02 02:38:15 +00:00
wiz
ddac63620b Sort sections and SEE ALSO. 2002-02-02 01:47:36 +00:00
wiz
a2d753e3ef Whitespace nits. 2002-01-19 11:44:57 +00:00
is
d8302e2d73 More format string cleanups by sommerfeld. 2000-10-11 20:23:46 +00:00
itojun
c8ebe62e8b avoid memory leak on realloc() error. 1999-12-30 09:10:28 +00:00
mjl
f214fa323a From FreeBSD bin/14844 (slightly modified): Due to signed calculations
with the packet size, a short packet would trigger an infinite loop
on little endian machines.
1999-11-15 15:59:24 +00:00
thorpej
bcd4659148 Use pidfile(3). 1999-06-06 03:27:35 +00:00
garbled
d1407362ba 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:43:46 +00:00
mrg
31283e2cd0 fix error in previous pointed out by bad. minor KNFing. 1998-07-08 15:17:57 +00:00
mrg
32f519716b - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:56:06 +00:00
msaitoh
e167016fdb The service name of the rwhod(8) is not "rwho" but "who". 1998-06-04 13:31:40 +00:00
lukem
e5d6d67c63 deprecate register, use warn/err 1997-10-18 11:37:10 +00:00
lukem
149f1867d1 rcsid fascism 1997-10-18 04:36:50 +00:00
lukem
8d79db1093 WARNSify 1997-10-17 13:13:40 +00:00
kleink
66105c37fc Lseek(2) usage cleanup: the use of L_SET/L_INCR/L_XTND is deprecated,
use SEEK_SET/SEEK_CUR/SEEK_END instead.
1997-08-25 19:31:43 +00:00
mikel
05938835d7 gethostname(3) is no longer a syscall 1997-07-14 01:43:49 +00:00
mikel
7fedc67b9e xref gethostname(3) not gethostname(2), RCSid police 1997-07-14 01:42:20 +00:00
cgd
dd7fbd1461 doesn't need libkvm any more 1997-03-08 22:21:55 +00:00
cgd
1e9c4131dc update structure definitions for 64-bit safety (already done in the relevant
header files), and kill the note about checking /netbsd's nlist, since that
is no longer done (since the kernel namelist isn't actually used for
anything).
1997-03-08 22:20:21 +00:00
explorer
d3a4eeb1fe Fix some potential buffer overflow problems.
From David Holland <dholland@hcs.harvard.edu>
1996-09-07 21:05:37 +00:00