Commit Graph

569 Commits

Author SHA1 Message Date
hubertf ccb3350fe4 Drop setgid privs passed from dm(6).
Patch submitted in PR 5945 by Joseph S. Myers <jsm28@cam.ac.uk>
1999-07-19 00:42:59 +00:00
hubertf 3521abbb40 As in previously sent patches: backgammon(6) does not need setgid
games privileges from dm, so should revoke them on startup.

Patch submitteed in PR 8024 bye Joseph Myers <jsm28@cam.ac.uk>
1999-07-19 00:33:58 +00:00
hubertf aac1ec24ab Adventure(6) should check for errors (e.g. disk full or quota
exceeded) when writing out saved games. Do so!

Patch supplied by Joseph Myers <jsm28@cam.ac.uk> in PR 8016
1999-07-17 20:02:48 +00:00
hubertf d5f85ed9c9 The patch below improves the security of the game atc(6), by having it
open the score file at the start and then drop all setgid privileges
while keeping a (close-on-exec) file descriptor open to it.  In order
to allow this the static data files have to be made world readable.
In addition a potential buffer overrun with corrupted score files is
avoided by more careful use of scanf (note that SCORE_SCANF_FMT is
defined alongside the definition of the relevant structure).

Submitted in PR 8015 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-17 19:57:03 +00:00
hubertf fbaff02b26 Add two .Els that nroff was complaining to miss. 1999-07-17 19:48:40 +00:00
hubertf dceb24647b This patch (a) makes arithmetic(6) revoke any setgid privileges it got
from dm; (b) marks an unused parameter as such.

Submitted in PR 8014 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-17 19:11:30 +00:00
hubertf adf74b1e92 This patch cleans up the handling of the variable `saved' in
adventure(6).  The handling of this variable is somewhat confusing,
since it is used for two different purposes (controlling the time
required before a saved game can be restored, and controlling various
aspects of dwarf behaviour); in fact, it is also declared twice in
hdr.h.  Except possibly when saving a game fails, these uses can never
interfere; when used for controlling dwarf behaviour, we always have
saved == -1.  This can be better understood with reference to the
original PDP-10 FORTRAN source (URL in patch, since hdr.h references
the comments of the FORTRAN as still relevant to this version) of
which the C version is a direct translation: the wrong value for
`saved' meant that someone was cheating and had bypassed normal
initialisation.  Saving was done by halting and telling the user to
save their core image, so the question of carrying on after saving
failed to open the output file did not arise.

This patch separates the uses of `saved' into uses of two separate
variables.

Closes PR 8005 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-16 01:38:20 +00:00
hubertf 24d3aaa397 Const poisoning.
Patch submitted in PR 7993 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-14 22:52:07 +00:00
hubertf 4502aed41f This patch fixes a -Wcast-qual warning in wump(6).
Submitted in 7994 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-14 22:49:27 +00:00
hubertf 9c8243f4e2 Fix scoring, submitted in PR 7992 by Joseph Myers <jsm28@cam.ac.uk> 1999-07-14 22:46:21 +00:00
hubertf 12a0758a42 From PR 7987 by Joseph Myers <jsm28@cam.ac.uk>:
More battlestar(6) spelling and punctuation fixes for battlestar(6).
These ones come from OpenBSD.
1999-07-14 17:42:13 +00:00
hubertf 148eb780dc This patch makes fish(6) honour PAGER for viewing the instructions.
The detailed behaviour follows POSIX.2.  A similar patch for wump(6)
which was accepted is in bin/6699.  Fish does not need any setgid
privileges it gets from dm, so this patch also moves the gid resetting
earlier.

Reported in PR 7986 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-14 17:30:21 +00:00
hubertf c1f52f97cd From PR 7988 by Joseph Myers <jsm28@cam.ac.uk>: use the symbolic
name SEEK_SET for values which end up as the third argument of
fseek(), rather than a hard-coded 0.
1999-07-14 17:23:53 +00:00
hubertf 76139748e2 From PR 7985 by Joseph Myers <jsm28@cam.ac.uk>:
games/adventure/setup.c fails to check for errors when writing its
output.  This means that, if the disk fills up at this point during a
build, it would nevertheless fail to return an error status.
1999-07-14 17:21:03 +00:00
sommerfeld 3365b567da man page rewritten into -mandoc by dholland@eecs.harvard.edu; from PR7861 1999-06-27 04:35:42 +00:00
christos 605ec8abd1 Fixi uninit vars warnings. 1999-05-16 00:15:46 +00:00
christos 4cb49d76cc Add missing prototypes 1999-05-16 00:03:35 +00:00
christos 18dfb39e84 Add -A for automatic playing mode.
Make the score file MI
1999-05-15 23:56:35 +00:00
kristerw 8e5038f0a3 Fix Y2K buffer overflow (from OpenBSD). 1999-04-25 19:08:34 +00:00
kristerw a9a6e776fa Buffer overflow fix (from OpenBSD) 1999-04-24 22:09:06 +00:00
simonb a2ed16d0dd initscr() returns a pointer, compare return value with NULL and not
an int.
Compatible with other versions of curses.
1999-04-18 03:30:12 +00:00
simonb 4e92840504 Don't frob the interals of a WINDOW*, use the mvinch() macro. 1999-04-18 03:29:01 +00:00
cgd b22750720f change:
.Sh "SEE ALSO"
to:
	.Sh SEE ALSO
The doc macros check for the latter (actually just for 'SEE' as the first
argument to .Sh) to set the section header SEE ALSO flag, which modifies
some behaviour (e.g. references done with .Rs/.Re).
1999-04-06 04:54:19 +00:00
abs 190c71aa67 s/SETUIDGAME/SETGIDGAME/ - catch up with the rest of the world. 1999-04-05 08:04:48 +00:00
mrg 4924ddc041 defined(attron) does not mean there is a <term.h> 1999-03-29 05:12:39 +00:00
hubertf dab3a74af9 Fix object recognition, per PR 6048 by Joseph S. Myers <jsm28@cam.ac.uk>. 1999-03-25 16:46:08 +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
abs 0a265153fb Newline and usage cosmetics from Soren S. Jorvang <soren@t.dk> PR7205 1999-03-22 06:12:23 +00:00
lukem 7e1c62baf8 set MKLINT=no. noted by NAKAJIMA Yoshihiro <nakayosh@kcn.ne.jp> 1999-03-13 23:17:46 +00:00
erh 55f3a4b91b Fix .Bl/.El imbalance. 1999-03-10 09:29:08 +00:00
lukem 868ca23db4 remove NOPROG (nothing uses it). however, set MKOBJ=no if appropriate 1999-02-13 23:53:56 +00:00
lukem dcab0210a0 convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
1999-02-13 02:54:17 +00:00
simonb 6372fa90cc Remove unneeded "mips compiler bug" workaround from original code imported
in 1994.
1999-02-11 02:34:24 +00:00
hubertf b0ed16a714 tgetent() handles const correctly in current 1999-02-10 17:08:06 +00:00
hubertf 752e969da2 Add __attribute__() to a variable. From PR 6557, after discussion with
Joseph S. Myers <jsm28@cam.ac.uk>
1999-02-10 12:38:54 +00:00
hubertf 92932dfcc8 The patch below makes the game backgammon(6) use `const' where
appropriate.  It also removes some obsolete, unused code to check the
number of users on the system (obsoleted by dm); removes a prototype
for an unused function that was removed earlier; and removes a control
character from one message that was I think intended to clear the
screen on some particular terminal (though I can't find the comment to
that effect in any of the BSD source trees I have handy) but no longer
serves any useful purpose.

From PR 6580 by Joseph Myers <jsm28@cam.ac.uk>.

Also contains two more patches, one in teachgammon/tutor.h (by Joseph)
and one in common_source/fancy.c (by me).
1999-02-10 12:29:47 +00:00
hubertf ce3b092b6d Only invoke pager given in $PAGER if output goes to a tty, feed pager
via stdin, per PR 6699 by Joseph Myers <jsm28@cam.ac.uk>
1999-02-10 01:44:34 +00:00
hubertf bd8be7848a Const poisoning, per PR 6660 by Joseph Myers <jsm28@cam.ac.uk> 1999-02-10 01:36:50 +00:00
hubertf 24f809b060 The game sail(6) has a function Write() which is used both with
integer arguments and with string arguments (cast to long, and in one
place to int).  The patch here cleans this up, making it into two
separate functions; this allows for the game to be made const-correct
in future and improves portability.

The patch also contains two other fragments: a change to use the
symbolic constant SEEK_END with fseek(), and a change to use snprintf
in one place to avoid a buffer overrun.

Via PR 6569 by Joseph Myers <jsm28@cam.ac.uk>.
1999-02-10 00:45:45 +00:00
hubertf c7bcded63e The patch below does some minor cleanup of adventure(6): an additional
use of const I missed in bin/6041; avoiding a signed/unsigned warning;
marking an unused parameter as such; revoking setgid privileges
(including the saved gid) rather than setuid ones; includes and
function prototypes in setup.c; the string passed to err() should not
end with a `.'.  Together with the patch sent concerning adventure's
EOF handling, this synchronises adventure(6) in NetBSD with the Linux
port of the NetBSD games.

Via PR 6557 by Joseph Myers <jsm28@cam.ac.uk>
1999-02-10 00:29:21 +00:00
hubertf 08ab0f321a The game adventure(6) handles EOF on standard input rather
ungracefully.  The patch, derived from OpenBSD, improves this
handling.

Sent in in PR 6556 by Joseph Myers <jsm28@cam.ac.uk>.
1999-02-10 00:11:28 +00:00
hubertf 6cfbee5947 only show preview if the -p option is given 1999-01-03 17:13:51 +00:00
hubertf 13aa60478d document morse's decode option -d 1999-01-03 17:12:28 +00:00
hubertf f42c52bee6 Add previewing of next shape. Old (previous) behaviour can be
restored by compiling with NO_PREVIEW defined.
1999-01-03 02:00:17 +00:00
tron 1c7a4fb141 Remove obsolete header file. Fixes PR bin/6700 by Joseph S. Myers. 1999-01-02 15:47:55 +00:00
dbj 16a09f01ca tweaks to pass DESTDIR to subprograms when it is defined in /etc/mk.conf
but is not in the environment.
1998-12-06 09:06:45 +00:00
pk f16cf517fe typo. 1998-12-05 21:09:23 +00:00
jwise ca027085f0 Fix spelling of `Churchill' in 3 places 1998-11-20 03:35:31 +00:00
hubertf d5f8b67ebe Add support for decoding of morse code. 1998-11-18 14:22:32 +00:00
hubertf 51755c03b2 fix usage 1998-11-18 09:06:26 +00:00