Commit Graph

122 Commits

Author SHA1 Message Date
Andrey A. Chernov
53a8ba6224 Make /dev/urandom fd static, or it pick up random descriptor
(stack garbadge) and read from it

Should go into 2.2
1997-03-08 18:01:40 +00:00
Andrey A. Chernov
08a77c42e1 Back out MAXLOGNAME fix, Bruce points that copyinstr require NUL 1997-03-03 07:59:54 +00:00
Andrey A. Chernov
7c66c05d49 Add +1 to NUL terminate after MAXLOGNAME 1997-03-02 21:52:02 +00:00
Eivind Eklund
44b732f7dc Actually remove sys/time.h hack; fix typo.
Pointed out by:	bde
1997-02-26 20:10:45 +00:00
Mike Pritchard
4b60ad3777 Allow fortune to use /dev/urandom if available to obtain its random
numbers.  If /dev/urandom is unavailable, it will fall back to
using the random() function.

I did this because I'm sick of seeing the same handful of fortunes
over and over, and I've seen the exact same fortune one too many times
when starting up two login shells at the same time.

2.2 safe.
1997-02-23 23:03:47 +00:00
Eivind Eklund
a98e812bb8 Fix sizeof/strlen typo and limit scanf length.
scanf spotted by:	Aarn Bornstein <aaronb@j51.com>
1997-02-23 05:15:52 +00:00
Eivind Eklund
6397b46dd2 Add setuid() before running the pager - from the code audit.
Submitted by:	Mark Huizer <xaa@stack.nl>
1997-02-23 03:29:36 +00:00
Peter Wemm
a794df83c5 Revert $FreeBSD$ to $Id$ 1997-02-22 14:46:58 +00:00
Mike Pritchard
90ac6cd46a #include <string.h> to help silence -Wall. 1997-02-20 23:11:22 +00:00
Eivind Eklund
c52e467e03 Remove buffer overflow and tempfile race, remove <sys/time.h> hack (and
need for it), change definition of setbit() macro and friends to be
compatible with <sys/param.h>.
The bugs were discovered and fixed as a result of the FreeBSD code audit.

Submitted by:	Aaron Bornstein <aaronb@j51.com>, Mark Huizer <xaa@stack.nl>
1997-02-20 03:04:54 +00:00
Masafumi Max NAKANE
80671631f8 List -h option also in the SYNOPSIS line. 1997-02-15 11:22:19 +00:00
Masafumi Max NAKANE
21bef06373 Added an option `-h' which gives you usage info.
(According to the original man page, giving `-' by itself as the argument
is supposed to do this, but it seems that it never worked that way.)
1997-02-15 06:12:07 +00:00
Masafumi Max NAKANE
9c4abf41ee Make the description of command-line args match the reality.
- Options must be preceeded by a `-'.
  - Backgammon doesn't give, and hasn't given you any usage info.
    (Maybe this should be fixed in the program.)
1997-02-11 18:52:55 +00:00
Warner Losh
2de57f9bbb Buffer overflow from OpenBSD
1.3 deraadt:
	buf oflow, felix@mamba.pond.sub.org
Obtained from: OpenBSD

Not sure how to exploit this, but may be a backmerge candidate.
1997-02-09 04:47:19 +00:00
Wolfram Schneider
c6234bb251 444 -> ${NOBINMODE}
/usr/share -> ${SHAREDIR}
/usr/games -> ${BINDIR}
1997-02-09 02:52:41 +00:00
Wolfram Schneider
ae7fb360a6 $* -> "$@"
use exec for last command in shell script
1997-02-09 01:09:33 +00:00
Poul-Henning Kamp
0923a4a551 The fact that people can't put the proper source on Kierkegaards
most famous insult to humanity can be forgiven, afterall, it
almost underlines the quote with irony, if one knows the context.

But to misspell the name of Alfred E. Neuman ...
1997-02-03 20:15:11 +00:00
Masafumi Max NAKANE
10c4031d64 Instead of swapping ruid and euid before and after touching user's file,
simply drop the privilege right after the program is started.
Thanks to bde for giving me good suggestion about this problem.
1997-02-01 21:30:50 +00:00
Masafumi Max NAKANE
7098ad6e2f Include string.h for prototype of strdup(). 1997-02-01 02:54:12 +00:00
Masafumi Max NAKANE
731955402d Style police:
- Indentation corrections
  - Spaces -> tabs.
  - func() -> func () (To be consistent with the original code.)
  - Check if getopt() returns -1, not EOF.

Suggested by:	bde
1997-01-31 15:04:23 +00:00
Masafumi Max NAKANE
7475ed31b5 Better handling of command-line argument:
1. Pass argc and argv to getarg and process them with getopt().
  2. Instead of using an array to save arg characters, use array of
    pointers and call backgammon/teachgammon with execv, instead of execl.

This should fix problems with calling teachgammon.
2.2 candidate.
1997-01-30 07:12:59 +00:00
Masafumi Max NAKANE
4fcfa50706 Oops, setreuid() also needed before and after opening/closing the recover file
in recover().
2.2 candidate.
1997-01-30 01:51:45 +00:00
Masafumi Max NAKANE
85d133dabd Do getreuid(geteuid(), getuid()) before opening file to save the game and
after closing it.
This fixes bug that user couldn't save the game in progress.
2.2 candidate.
1997-01-30 01:29:28 +00:00
Mike Pritchard
aa693224eb Correct some grammar. Closes PR# 2520.
Submitted by:	 John-Mark Gurney <gurney_j@efn.org>
1997-01-26 05:07:58 +00:00
Masafumi Max NAKANE
427910f0e2 Fix typo in instruction message. 1997-01-23 09:02:49 +00:00
Masafumi Max NAKANE
54ddcf4fa1 When calling recover() from getarg(), also check to see if the first
character of the argument being processed isn't '\0'.

This fixes problem with backgammon exiting abnormally when you answer 'y' to
the question it asks if you need instruction for the game.

2.2 cnadidate, maybe?
1997-01-23 04:41:01 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Mike Pritchard
7bc9296d98 Fix some typos and remove a couple of duplicate
fortunes.  Closes PR#s 2358 and 2402.

Submitted by:	John-Mark Gurney <gurney_j@efn.org>
1997-01-08 07:04:44 +00:00
Bruce Evans
015a0dc2e4 Use ${COPY} instead of -c for installing non-source files. 1997-01-01 04:22:23 +00:00
Wolfram Schneider
48a07755f9 comma police for section SEE ALSO
Sponsored by: Vin de Pays de l'Aude
1996-12-22 23:17:39 +00:00
Mike Pritchard
a90e2d2a62 Correct the location of the trek documentation in the
SEE ALSO section of the man page.  Closes PR# 2009.
1996-12-14 18:34:56 +00:00
Bruce Evans
58fd4e52ca Fixed extra columns in output for input lines with leading spaces. 1996-12-13 14:28:59 +00:00
Bruce Evans
fc15f74a8b Made `setup' depend on libraries. 1996-12-13 14:19:00 +00:00
Bruce Evans
5ce1f070f9 Fixed missing declaration of malloc(). 1996-12-13 13:59:34 +00:00
Bruce Evans
621d611a9d Hack around misuse of reserved names clock' and and time' in a different
way.  Defining KERNEL before including <sys/time.h> broke when "opt_cpu.h"
was included in a deeply nested header, except in -current where the
problem is masked by a namespace pollution bug in <stdio.h>.
1996-12-13 13:12:02 +00:00
Jordan K. Hubbard
78b44da72f Remove bogus declaration of malloc(). Closes PR#2197 1996-12-13 07:37:10 +00:00
Gary Palmer
a818b58970 Fix minor typo/grammatical error
Submitted by:	John-Mark Gurney <jmg@nike.efn.org> in PR 2085
1996-11-22 22:16:25 +00:00
Jordan K. Hubbard
34b8396337 If not on a tty, don't do "--more--" processing. Someday, I will get
rogomatic to work with this version. :)
1996-11-07 09:27:23 +00:00
Andrey A. Chernov
83aac36ef7 Uncomment static from collate_range_cmp, no more in locale.h 1996-10-31 14:49:40 +00:00
Andrey A. Chernov
327b0f7e8d Replace collate_range_cmp call with its code 1996-10-31 14:38:09 +00:00
Jordan K. Hubbard
0a9fa9a339 Install the rumors file.
Submitted-By: koshy@india.hp.com
Closes-PR#: 1883
1996-10-19 20:11:45 +00:00
Alexander Langer
0a5e7ccdf9 Set the effective user id to that of the real user id when
saving/restoring a game (necessary when adventure is invoked via dm).
1996-10-15 01:53:48 +00:00
Wolfram Schneider
e83201b43a delete doubled words, e.g.: "the the" -> "the" 1996-10-05 22:27:30 +00:00
Bruce Evans
0c8ea4d48c Eliminated includes of the "temporary" backwards compatibility header
<sys/dir.h> in applications.  Maintained existing (inadequate) ifdefs
for dir.h vs dirent.h in libdialog, amd and rarpd, but didn't add any
new ones.
1996-09-24 08:08:11 +00:00
Bruce Evans
76a4217503 Fixed annoying non-null output for `make depend'. SRCS should only
be used for C, C++ and assembler sources if <bsd.prog.mk> is
included.  It was used for general files.  This caused the __depend_*
lists in <bsd.dep.mk> to be empty, so mkdep was never run, so
.depend never existed, so it was always out of date, so `rm -f
.depend' was always executed to update it.
1996-09-22 14:45:23 +00:00
Bruce Evans
5b963fa12e Fixed DPADD. 1996-09-05 17:16:10 +00:00
Andrey A. Chernov
5f02527325 Convert to newly aded collate compare function 1996-08-12 19:12:40 +00:00
Andrey A. Chernov
351472c6df Pick collate info too 1996-08-12 12:24:20 +00:00
Joerg Wunsch
706b948138 Correctly declare main() as `int'.
Closes PR # bin/1385: /usr/games/pom, invalid de...

Submitted by:	zach@freebsd.gaffaneys.com (Zach Heilig)
1996-07-17 20:13:33 +00:00
Jordan K. Hubbard
cd9a2f5c28 Bring in my changes for removing the pestilent obj links (unless you
really want them) from /usr/src.  This is the final version of the
patches, incorporating the feedback I've received from -current.
1996-06-24 04:26:21 +00:00