dholland [Sun, 3 Feb 2008 21:24:58 +0000 (21:24 +0000)]
Once upon a time, larn 12.0 had functions named getchar() and putchar()
that conflicted with libc. We changed them to lgetchar() and xputchar()
respectively; larn 12.2 changed them to ttgetch() and ttputch(). After
reflecting on this for a while I've decided to adopt the larn 12.2
names; not so much for compatibility but for consistency going forward.
So, massrename them. Also make ttputch() static.
dholland [Sun, 3 Feb 2008 20:01:24 +0000 (20:01 +0000)]
A long time ago, larn had code to prohibit playing it during work hours.
Most of this code was removed ages ago, probably when dm(6) was invented;
long before -r1.1 in the NetBSD tree in any event.
Now remove the last fragment of it.
Also nuke the file of US holidays 1987-1993 that we've been carrying
around for no reason.
matt [Sat, 2 Feb 2008 18:15:14 +0000 (18:15 +0000)]
Add a -d flag so that primes will print the difference between the current
prime and the previous prime. [I needed that for some reason I don't recall
and these changes lying about. Since they might be useful/interesting to
someone, I might as well as commit them.]
dholland [Mon, 28 Jan 2008 05:48:57 +0000 (05:48 +0000)]
Call srandom() as well as initializing the private random generator
(which is crappy and should be removed, but that's for another day...)
This way e.g. fortune cookies no longer appear always in the same order.
dholland [Mon, 28 Jan 2008 04:04:17 +0000 (04:04 +0000)]
Apparently the reason the printf arguments were all wrong is that larn
had its own private and not-quite-standard implementation of printf.
Remove it surgically with a chainsaw.
dholland [Mon, 28 Jan 2008 03:39:30 +0000 (03:39 +0000)]
Add gcc printf format checking, and fix the abundant problems this revealed.
(It appears that someone sometime thought that you use %d to print a long.)
dholland [Mon, 28 Jan 2008 02:37:50 +0000 (02:37 +0000)]
Work around gcc signedness warning: if you check for uid_t < 0, gcc warns
because it's unsigned, but I don't really want to rely on uid_t being
unsigned on every platform this code might propagate to.
dholland [Mon, 28 Jan 2008 01:38:59 +0000 (01:38 +0000)]
Build with WARNS=4. (All fixes are cosmetic, except that it's definitely
bad karma to shadow a local variable with another of the same name in a
nested block...)
dholland [Mon, 14 Jan 2008 03:50:01 +0000 (03:50 +0000)]
ANSIfy. Remove unnecessary casts. Clean up for -Wsign-compare. Make more
things file-static. Other minor tidyups, and fix a couple minor bugs found
along the way.
dholland [Thu, 27 Dec 2007 23:52:59 +0000 (23:52 +0000)]
Comprehensive (or at least extensive) string handling cleanup for rogue.
This patch dates (mostly) back to 2002; the critical parts of it were
handled back then by security-officer. As far as I know, there's
nothing exploitable fixed herein.
A slightly earlier version of this patch was reviewed by Christian Biere
when I filed it as PR 34750.
dogcow [Tue, 18 Dec 2007 08:45:03 +0000 (08:45 +0000)]
more __dead fallout: these two files are built for the native host, not
for the target host - and thus do not necessarily have __dead defined in
<sys/cdefs.h>.
dogcow [Sat, 17 Nov 2007 00:10:55 +0000 (00:10 +0000)]
A terrible kludge: don't compile/link malloc.c if arch=sun2. My apologies
to the legions of sun2 monop fans who will probably be unable to save/restore
games.
tls [Mon, 28 May 2007 12:06:17 +0000 (12:06 +0000)]
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.
hubertf [Wed, 24 Jan 2007 13:17:42 +0000 (13:17 +0000)]
- Don't call basename $0 at many places. Use variable $PROGNAME
- Better check when neither $ACRONYMDB is define nor files in
/usr/share/misc/ are found
- Replace cat | fgrep to using fgrep only
- Replace sort | uniq to using sort -u
By Slava Semushin <slava.semushin@gmail.com> in private email.
chuck [Wed, 17 Jan 2007 02:35:28 +0000 (02:35 +0000)]
Update my previous commit to better match the original code, including
the check for 'bs'... my previous commit should have included the
following text:
fixes problem introduced in 1.13 where the setting of "BC" (backspace char)
was left to libterm rather than being done by hack itself. the problem
with this was that hack was directly setting BC to \b if there was no
"bc" in the termcap entry, but libterm does not do this. this resulted in
the xputs(BC) calls in nocmov() and backsp() incorrectly doing nothing, thus
messing up the display. added new var BC_BS to provide the old behavior
for nocmov() and backsp().
reed [Wed, 22 Nov 2006 16:15:42 +0000 (16:15 +0000)]
Check that -w width is not above maximum. (It already checks for zero or
negative.) Using width above DWIDTH may cause overflow as noted by Gruzicki
Wlodek on bugtraq.
hubertf [Sat, 24 Jun 2006 13:32:45 +0000 (13:32 +0000)]
Attribute ``A language that doesn't affect the way you think about
programming is not worth knowing.'' to Alan Perlis, per Diomidis Spinellis'
blog at http://www.spinellis.gr/blog/20060424/
jnemeth [Wed, 7 Jun 2006 09:30:35 +0000 (09:30 +0000)]
Don't follow symlinks on systems that have O_NOFOLLOW.
Don't bother looping with lockf() since first iteration would return.
Prevent two buffer overflows.
drochner [Thu, 1 Jun 2006 16:12:27 +0000 (16:12 +0000)]
Better check data read from tetris.scores before use as array indices etc.
This is CVE-2006-1539, files against Gentoo Linux, the patch is from
Gentoo.
A standard NetBSD installation is not as much risk because tetris is
sgid "games", and users shouldn't be in that group.