summaryrefslogtreecommitdiffstats
path: root/boggle
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1999-07-21 04:02:29 +0000
committerhubertf <hubertf@NetBSD.org>1999-07-21 04:02:29 +0000
commitd684ac08bcd0a8d6f6eabbe3e62fccee34f6cea4 (patch)
treed6fcf209f4c3111805c4ccf7e724d604eaf706c6 /boggle
parent220927d0337af158483f0d006da703b9d5330cef (diff)
downloadbsdgames-darwin-d684ac08bcd0a8d6f6eabbe3e62fccee34f6cea4.tar.gz
bsdgames-darwin-d684ac08bcd0a8d6f6eabbe3e62fccee34f6cea4.tar.zst
bsdgames-darwin-d684ac08bcd0a8d6f6eabbe3e62fccee34f6cea4.zip
Drop setgid privs early. Via OpenBSD, reported in PR 5970 by
Joseph Myers <jsm28@cam.ac.uk>
Diffstat (limited to 'boggle')
-rw-r--r--boggle/boggle/bog.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/boggle/boggle/bog.c b/boggle/boggle/bog.c
index 232e4aac..4e6c4c79 100644
--- a/boggle/boggle/bog.c
+++ b/boggle/boggle/bog.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bog.c,v 1.10 1999/07/14 17:23:53 hubertf Exp $ */
+/* $NetBSD: bog.c,v 1.11 1999/07/21 04:02:29 hubertf Exp $ */
/*-
* Copyright (c) 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\n\
#if 0
static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: bog.c,v 1.10 1999/07/14 17:23:53 hubertf Exp $");
+__RCSID("$NetBSD: bog.c,v 1.11 1999/07/21 04:02:29 hubertf Exp $");
#endif
#endif /* not lint */
@@ -132,6 +132,9 @@ main(argc, argv)
int ch, done, i, selfuse, sflag;
char *bspec, *p;
+ /* revoke setgid privileges */
+ setregid(getgid(), getgid());
+
seed = 0;
batch = debug = reuse = selfuse = sflag = 0;
bspec = NULL;