diff options
| author | jsm <jsm@NetBSD.org> | 2000-02-09 22:27:55 +0000 |
|---|---|---|
| committer | jsm <jsm@NetBSD.org> | 2000-02-09 22:27:55 +0000 |
| commit | 6a2a60db41cc5b3db833740e9381e58f5270a775 (patch) | |
| tree | 2437ba95f91b7f0cdaa57157b4588f68a0e652f4 /sail/misc.c | |
| parent | dc6fb5dc49807bdfab1b64b687522b76a6492011 (diff) | |
| download | bsdgames-darwin-6a2a60db41cc5b3db833740e9381e58f5270a775.tar.gz bsdgames-darwin-6a2a60db41cc5b3db833740e9381e58f5270a775.zip | |
Fix insecure /tmp usage in sail.
Essentially concludes the merge into NetBSD of those changes in the
Linux port of the NetBSD games which it is fairly clear to me should
be so merged.
Diffstat (limited to 'sail/misc.c')
| -rw-r--r-- | sail/misc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sail/misc.c b/sail/misc.c index c78e952f..3247cff7 100644 --- a/sail/misc.c +++ b/sail/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.5 1997/10/13 19:44:38 christos Exp $ */ +/* $NetBSD: misc.c,v 1.6 2000/02/09 22:27:56 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: misc.c,v 1.5 1997/10/13 19:44:38 christos Exp $"); +__RCSID("$NetBSD: misc.c,v 1.6 2000/02/09 22:27:56 jsm Exp $"); #endif #endif /* not lint */ @@ -208,8 +208,12 @@ struct ship *s; float net; struct logs *lp; - if ((fp = fopen(_PATH_LOGFILE, "r+")) == NULL) + setegid(egid); + if ((fp = fopen(_PATH_LOGFILE, "r+")) == NULL) { + setegid(gid); return; + } + setegid(gid); #ifdef LOCK_EX if (flock(fileno(fp), LOCK_EX) < 0) return; |
