diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-12-19 22:22:18 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-12-19 22:22:18 +0000 |
commit | e666495d5bec1a6aebe384303efe5f31db6aed2b (patch) | |
tree | 80acd2a5798eea45c4eaacfe133fe15feed672c1 /games/canfield | |
parent | 0333603e546677747279b0dc4cd7292bad1abb7c (diff) |
setgid games, not setuid games. closes a neat set of holes
Diffstat (limited to 'games/canfield')
-rw-r--r-- | games/canfield/canfield/canfield.c | 3 | ||||
-rw-r--r-- | games/canfield/cfscores/cfscores.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/games/canfield/canfield/canfield.c b/games/canfield/canfield/canfield.c index 406b698dbc9..9028522839d 100644 --- a/games/canfield/canfield/canfield.c +++ b/games/canfield/canfield/canfield.c @@ -1578,10 +1578,10 @@ initall() srandom(getpid()); time(&acctstart); initdeck(deck); - uid = getuid(); if (uid < 0) uid = 0; dbfd = open(_PATH_SCORE, 2); + setegid(getgid()); if (dbfd < 0) return; i = lseek(dbfd, uid * sizeof(struct betinfo), 0); @@ -1699,6 +1699,7 @@ main(argc, argv) raw(); noecho(); initall(); + setgid(getgid()); /* revoke */ instruct(); makeboard(); for (;;) { diff --git a/games/canfield/cfscores/cfscores.c b/games/canfield/cfscores/cfscores.c index 4a3a0e8f782..520c401a9ef 100644 --- a/games/canfield/cfscores/cfscores.c +++ b/games/canfield/cfscores/cfscores.c @@ -80,6 +80,7 @@ main(argc, argv) perror(_PATH_SCORE); exit(2); } + setgid(getgid()); /* revoke */ setpwent(); if (argc == 1) { uid = getuid(); |