From d8e95d8c1a6a0918fc9dda2ca247833ad222696d Mon Sep 17 00:00:00 2001 From: eivind Date: Mon, 1 Sep 1997 00:34:51 +0000 Subject: Change games from setuid games to setgid games. Reviewed by: maybe@yes.no Obtained from: OpenBSD (mostly deraadt@openbsd.org) --- games/backgammon/backgammon/main.c | 4 ++++ games/backgammon/teachgammon/teach.c | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'games/backgammon') diff --git a/games/backgammon/backgammon/main.c b/games/backgammon/backgammon/main.c index 97f0c6a..270e1f5 100644 --- a/games/backgammon/backgammon/main.c +++ b/games/backgammon/backgammon/main.c @@ -110,6 +110,10 @@ char **argv; uid = getuid(); setreuid (uid,uid); + /* revoke privs */ + setegid(getgid()); + setgid(getgid()); + /* initialization */ bflag = 2; /* default no board */ acnt = 1; /* Nuber of args */ diff --git a/games/backgammon/teachgammon/teach.c b/games/backgammon/teachgammon/teach.c index bae186c..1c70b04 100644 --- a/games/backgammon/teachgammon/teach.c +++ b/games/backgammon/teachgammon/teach.c @@ -80,11 +80,10 @@ char **argv; { register int i; - uid_t uid; - /*Drop the privilege.*/ - uid = getuid(); - setreuid (uid,uid); + /* revoke privs */ + setegid(getgid()); + setgid(getgid()); acnt = 1; signal (2,getout); -- cgit v1.1