diff options
author | hubertf <hubertf@NetBSD.org> | 1999-02-10 00:29:21 +0000 |
---|---|---|
committer | hubertf <hubertf@NetBSD.org> | 1999-02-10 00:29:21 +0000 |
commit | e0e186091a777dfe9cf3c22deeff989f459d8db9 (patch) | |
tree | f28a15fe571fc35e9f50726951538e946868c3b2 /adventure/main.c | |
parent | 638c095d5cf47282d99189e1425435a0763a369b (diff) | |
download | bsdgames-darwin-e0e186091a777dfe9cf3c22deeff989f459d8db9.tar.gz bsdgames-darwin-e0e186091a777dfe9cf3c22deeff989f459d8db9.tar.zst bsdgames-darwin-e0e186091a777dfe9cf3c22deeff989f459d8db9.zip |
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>
Diffstat (limited to 'adventure/main.c')
-rw-r--r-- | adventure/main.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/adventure/main.c b/adventure/main.c index e3112c12..aa21cf8c 100644 --- a/adventure/main.c +++ b/adventure/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.12 1998/09/14 09:29:08 hubertf Exp $ */ +/* $NetBSD: main.c,v 1.13 1999/02/10 00:29:21 hubertf Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -48,7 +48,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\ #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/2/93"; #else -__RCSID("$NetBSD: main.c,v 1.12 1998/09/14 09:29:08 hubertf Exp $"); +__RCSID("$NetBSD: main.c,v 1.13 1999/02/10 00:29:21 hubertf Exp $"); #endif #endif /* not lint */ @@ -73,9 +73,8 @@ main(argc, argv) int rval, ll; struct text *kk; - /* adventure doesn't need setuid-ness, so, just get rid of it */ - if (setuid(getuid()) < 0) - warn("setuid"); + /* revoke setgid privileges from dm */ + setregid(getgid(), getgid()); init(); /* Initialize everything */ signal(SIGINT, trapdel); |