mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-21 03:14:50 +00:00
copy in from cvs; cvs2svn fucked up big time
git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@9775 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
# $NetBSD: Makefile,v 1.8 1997/11/19 08:23:37 mrg Exp $
|
||||
# $NetBSD: Makefile,v 1.11 2002/09/18 03:23:00 lukem Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
# -DLOG log games
|
||||
PROG= dm
|
||||
SRCS= dm.c utmpentry.c
|
||||
MAN= dm.8 dm.conf.5
|
||||
# shouldn't be necessary; just in case.
|
||||
BINGRP= games
|
||||
BINMODE=2555
|
||||
|
||||
.PATH.c: ${NETBSDSRCDIR}/usr.bin/who
|
||||
CPPFLAGS+=-I${NETBSDSRCDIR}/usr.bin/who -DSUPPORT_UTMPX -DSUPPORT_UTMP
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
28
dm/Makefrag
28
dm/Makefrag
@@ -1,7 +1,33 @@
|
||||
# Makefrag - makefile fragment for dm
|
||||
#
|
||||
# Copyright (c) 1997, 1998, 1999 Joseph Samuel Myers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
|
||||
# Add -DLOG if you want logging
|
||||
dm_DEFS := # -DLOG
|
||||
dm_DEFS := $(GETLOADAVG_DEFS) # -DLOG
|
||||
dm_DIRS := $(GAMESDIR) $(MAN8DIR) $(MAN5DIR)
|
||||
|
||||
dm_all: dm/dm dm/dm.8 dm/dm.conf.5
|
||||
|
||||
@@ -10,4 +10,4 @@ Add -DLOG to the DEFS in the Makefile if you want logging of games
|
||||
playing.
|
||||
|
||||
Joseph S. Myers
|
||||
jsm28@cam.ac.uk
|
||||
jsm@polyomino.org.uk
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: dm.8,v 1.6 1998/06/08 12:41:41 lukem Exp $
|
||||
.\" $NetBSD: dm.8,v 1.8 2003/02/25 10:34:45 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1987, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@@ -48,7 +48,7 @@ is a program used to regulate game playing.
|
||||
.Nm
|
||||
expects to be invoked with the name of a game that a user wishes to play.
|
||||
This is done by creating symbolic links to
|
||||
.Nm "" ,
|
||||
.Nm ,
|
||||
in the directory
|
||||
.Pa @gamesdir@
|
||||
for all of the regulated games.
|
||||
@@ -63,8 +63,7 @@ program.
|
||||
determines if the requested game is available and, if so, runs it.
|
||||
The file
|
||||
.Pa @dm_configfile@
|
||||
controls the conditions under which games may
|
||||
be run.
|
||||
controls the conditions under which games may be run.
|
||||
.Pp
|
||||
The file
|
||||
.Pa @dm_nogamesfile@
|
||||
@@ -99,7 +98,7 @@ running the games setgid
|
||||
First, all games that allow users to run
|
||||
.Ux
|
||||
commands should carefully
|
||||
set both the real and effective group id's immediately before executing
|
||||
set both the real and effective group ids immediately before executing
|
||||
those commands.
|
||||
Probably more important is that
|
||||
.Nm
|
||||
|
||||
12
dm/dm.c
12
dm/dm.c
@@ -1,4 +1,5 @@
|
||||
/* $NetBSD: dm.c,v 1.11 1998/09/13 15:27:27 hubertf Exp $ */
|
||||
/* $NetBSD: dm.c,v 1.17 2002/08/02 03:06:24 christos Exp $ */
|
||||
/* For Linux: still using old utmp interface from version 1.16. */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1987, 1993
|
||||
@@ -43,7 +44,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dm.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: dm.c,v 1.11 1998/09/13 15:27:27 hubertf Exp $");
|
||||
__RCSID("$NetBSD: dm.c,v 1.17 2002/08/02 03:06:24 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -83,7 +84,7 @@ int users __P((void));
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc __attribute__((unused));
|
||||
int argc __attribute__((__unused__));
|
||||
char *argv[];
|
||||
{
|
||||
char *cp;
|
||||
@@ -116,10 +117,7 @@ play(args)
|
||||
{
|
||||
char pbuf[MAXPATHLEN];
|
||||
|
||||
(void)strncpy(pbuf, _PATH_HIDE, sizeof(pbuf) - 1);
|
||||
(void)strncpy(pbuf + sizeof(_PATH_HIDE) - 1, game,
|
||||
sizeof(pbuf) - sizeof(_PATH_HIDE) - 1);
|
||||
pbuf[sizeof(pbuf) - 1] = '\0';
|
||||
snprintf(pbuf, sizeof(pbuf), "%s%s", _PATH_HIDE, game);
|
||||
if (priority > 0) /* < 0 requires root */
|
||||
(void)setpriority(PRIO_PROCESS, 0, priority);
|
||||
execv(pbuf, args);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: dm.conf.5,v 1.5 1998/04/29 18:16:01 fair Exp $
|
||||
.\" $NetBSD: dm.conf.5,v 1.7 2002/09/26 18:32:00 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1988, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@@ -35,7 +35,7 @@
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt DM.CONF 5
|
||||
.Os BSD 4.2
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm dm.conf
|
||||
.Nd dungeon master configuration file
|
||||
@@ -59,8 +59,7 @@ Entries consist of two white-space separated fields: the string
|
||||
.Em badtty
|
||||
and the ttyname as returned by
|
||||
.Xr ttyname 3 .
|
||||
For example,
|
||||
to keep the uucp dialout,
|
||||
For example, to keep the uucp dialout,
|
||||
.Dq tty19 ,
|
||||
from being used for games, the entry would be:
|
||||
.Bd -literal -offset indent
|
||||
@@ -94,17 +93,14 @@ in no game limitation or priority based on that field.
|
||||
.Pp
|
||||
The game
|
||||
.Em default
|
||||
controls the settings for
|
||||
any game not otherwise listed, and must be the last
|
||||
controls the settings for any game not otherwise listed, and must be the last
|
||||
.Em game
|
||||
entry in the file.
|
||||
Priorities may not be negative.
|
||||
For example, the following entries
|
||||
limits the game
|
||||
For example, the following entries limits the game
|
||||
.Dq hack
|
||||
to running only when the system has 10 or less
|
||||
users and a load average of 5 or less; all other games may be run any time
|
||||
the system has 15 or less users.
|
||||
to running only when the system has 10 or less users and a load average of 5
|
||||
or less; all other games may be run any time the system has 15 or less users.
|
||||
.Bd -literal -offset indent
|
||||
game hack 5 10 *
|
||||
game default * 15 *
|
||||
|
||||
Reference in New Issue
Block a user