Commit Graph

591 Commits

Author SHA1 Message Date
hubertf 6c243d931c This patch improves the handling of save files in battlestar(6), by
allowing the user to choose the name of the save file and specify it
on the command line when restoring.  It also eliminates a buffer
overrun in determining the path to the save file, and any particular
arbitrary limit on the name length.  In the name of a tidier home
directory, the default name is changed from "Bstar" to ".Bstar".

Patch supplied in PR 8085 by Joseph Myers <jsm28@cam.ac.uk>
Minor modification (s/startup/filename/ in initialize()) by me.
1999-07-28 01:45:41 +00:00
drochner b0c1735026 make sure only whole words are matched, use [:space:] RE to avoid embedded
<TAB>s
1999-07-27 15:41:27 +00:00
hubertf 6ec2bcb1c2 Remove empty functin check_adir() and references to it. 1999-07-26 21:14:21 +00:00
hubertf 83d9f5b7e0 This patch adds to backgammon(6) a couple of noreturn attributes
missed in bin/6144.

Patch submitted in PR 8082 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-26 20:56:03 +00:00
hubertf b8d8fccc22 This patch makes backgammon(6) check that, if you use the -s option to
recover a saved game, then you specify a file name.

Patch submitted in PR 8081 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-26 20:50:44 +00:00
hubertf 79705e8498 This adds a check for memory allocation failure to one place in
backgammon(6).  The use of write(2) for the message may seem odd, but
is used in another place in this game.  (Actually, a lot of
backgammon(6) could do with being substantially cleaned up.)

Patch submitted in PR 8080 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-26 18:39:06 +00:00
briggs b0412de83c Check whatis(1) if we don't find an acronym matching the argument 1999-07-25 20:29:04 +00:00
thorpej 2464b36e0a We're in section 6. 1999-07-25 20:02:48 +00:00
hubertf 03fc787fb7 This patch marks unused parameters in atc(6) as such.
Patch submitted in PR 8058 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-25 00:24:38 +00:00
hubertf 420d34ff13 Hardcore const poisoning
Patch submitted by Joseph Myers <jsm28@cam.ac.uk> in PR 8057
1999-07-25 00:06:13 +00:00
hubertf 5cfc1e8dc6 This patch makes atc(6) check for memory allocation failure.
Patch submitted by Joseph Myers <jsm28@cam.ac.uk> in PR 8056,
with small enhancement to make clearer when loser() is called
with NULL.
1999-07-24 23:58:15 +00:00
mjl c5a4ae7a2a Use getopt instead of home grown command line parsing.
Patch from Joseph Myers <jsm28@cam.ac.uk> in PR/8062.
1999-07-24 15:50:44 +00:00
lukem fb5a2a2eb1 remove sh warning when invoked with no args 1999-07-22 10:08:17 +00:00
mrg 7199fd8f7b add wtf 1999-07-22 01:05:20 +00:00
mrg 3fd868859a Allen Briggs' wtf(6) to grovel the acronyms database. 1999-07-22 01:03:20 +00:00
hubertf b7e11e5c37 const poisoning
Patch submitted in PR 8039 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-21 13:19:10 +00:00
hubertf 6cc6041b97 When atc(6) parses its game definition files, the check for `width'
being defined more than once incorrectly checks for `height' having
been previously defined instead.

Patch submitted in PR 8038 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-21 13:10:47 +00:00
hubertf e1c8885621 Drop setgid privs early, via OpenBSD
Reported in PR 5970 by Joseph Myers <jsm@octomino.demon.co.uk>
1999-07-21 04:04:21 +00:00
hubertf 7287839679 Drop setgid privs early. Via OpenBSD, reported in PR 5970 by
Joseph Myers <jsm28@cam.ac.uk>
1999-07-21 04:02:29 +00:00
hubertf 22c39e3b98 Drop setgid privs early; via OpenBSD reported in PR 5970 by
Joseph Myers <jsm28@cam.ac.uk>
1999-07-21 03:59:41 +00:00
hubertf 054e79fedd Drop setgid privileges early. Derived from OpenBSD and sent in as PR 5970
by Joseph Myers <jsm28@cam.ac.uk>.
1999-07-21 03:56:53 +00:00
hubertf 146de2e635 Back out last due to think o on my side: we don't start banner through
dm(6), so there's no setgid privileges to discard. Pointed out by
Joseph S. Myers <jsm28@cam.ac.uk>
1999-07-19 19:07:17 +00:00
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