Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/backgammon As in previously sent patches: backgammon(6...
details: https://anonhg.NetBSD.org/src/rev/ee645d163ad4
branches: trunk
changeset: 474752:ee645d163ad4
user: hubertf <hubertf%NetBSD.org@localhost>
date: Mon Jul 19 00:33:58 1999 +0000
description:
As in previously sent patches: backgammon(6) does not need setgid
games privileges from dm, so should revoke them on startup.
Patch submitteed in PR 8024 bye Joseph Myers <jsm28%cam.ac.uk@localhost>
diffstat:
games/backgammon/backgammon/main.c | 7 +++++--
games/backgammon/teachgammon/teach.c | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diffs (56 lines):
diff -r ae5af95fe34b -r ee645d163ad4 games/backgammon/backgammon/main.c
--- a/games/backgammon/backgammon/main.c Sun Jul 18 23:55:57 1999 +0000
+++ b/games/backgammon/backgammon/main.c Mon Jul 19 00:33:58 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.10 1999/07/14 22:46:21 hubertf Exp $ */
+/* $NetBSD: main.c,v 1.11 1999/07/19 00:33:58 hubertf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.10 1999/07/14 22:46:21 hubertf Exp $");
+__RCSID("$NetBSD: main.c,v 1.11 1999/07/19 00:33:58 hubertf Exp $");
#endif
#endif /* not lint */
@@ -99,6 +99,9 @@
char c; /* non-descript character storage */
long t; /* time for random num generator */
+ /* revoke setgid privileges */
+ setregid(getgid(), getgid());
+
/* initialization */
bflag = 2; /* default no board */
signal(SIGINT, getout); /* trap interrupts */
diff -r ae5af95fe34b -r ee645d163ad4 games/backgammon/teachgammon/teach.c
--- a/games/backgammon/teachgammon/teach.c Sun Jul 18 23:55:57 1999 +0000
+++ b/games/backgammon/teachgammon/teach.c Mon Jul 19 00:33:58 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: teach.c,v 1.8 1999/02/10 12:29:48 hubertf Exp $ */
+/* $NetBSD: teach.c,v 1.9 1999/07/19 00:34:00 hubertf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: teach.c,v 1.8 1999/02/10 12:29:48 hubertf Exp $");
+__RCSID("$NetBSD: teach.c,v 1.9 1999/07/19 00:34:00 hubertf Exp $");
#endif
#endif /* not lint */
@@ -72,6 +72,9 @@
{
int i;
+ /* revoke setgid privileges */
+ setregid(getgid(), getgid());
+
signal(SIGINT, getout);
if (tcgetattr(0, &old) == -1) /* get old tty mode */
errexit("teachgammon(gtty)");
Home |
Main Index |
Thread Index |
Old Index