diff options
author | hubertf <hubertf@NetBSD.org> | 1999-07-17 19:11:30 +0000 |
---|---|---|
committer | hubertf <hubertf@NetBSD.org> | 1999-07-17 19:11:30 +0000 |
commit | 6a05f71d737fffdcfdf8a4902b539b106e4c19d1 (patch) | |
tree | 1110fa61322c71ba3efb37bcfbeda675bd9d2b5a /arithmetic/arithmetic.c | |
parent | ae9b67f6a8d26e5428a3cbefadaa66889d4c9137 (diff) | |
download | bsdgames-darwin-6a05f71d737fffdcfdf8a4902b539b106e4c19d1.tar.gz bsdgames-darwin-6a05f71d737fffdcfdf8a4902b539b106e4c19d1.tar.zst bsdgames-darwin-6a05f71d737fffdcfdf8a4902b539b106e4c19d1.zip |
This patch (a) makes arithmetic(6) revoke any setgid privileges it got
from dm; (b) marks an unused parameter as such.
Submitted in PR 8014 by Joseph Myers <jsm28@cam.ac.uk>
Diffstat (limited to 'arithmetic/arithmetic.c')
-rw-r--r-- | arithmetic/arithmetic.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arithmetic/arithmetic.c b/arithmetic/arithmetic.c index ad0e7b57..d06776b8 100644 --- a/arithmetic/arithmetic.c +++ b/arithmetic/arithmetic.c @@ -1,4 +1,4 @@ -/* $NetBSD: arithmetic.c,v 1.12 1998/09/14 09:13:46 hubertf Exp $ */ +/* $NetBSD: arithmetic.c,v 1.13 1999/07/17 19:11:30 hubertf Exp $ */ /* * Copyright (c) 1989, 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)arithmetic.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: arithmetic.c,v 1.12 1998/09/14 09:13:46 hubertf Exp $"); +__RCSID("$NetBSD: arithmetic.c,v 1.13 1999/07/17 19:11:30 hubertf Exp $"); #endif #endif /* not lint */ @@ -122,6 +122,9 @@ main(argc, argv) extern int optind; int ch, cnt; + /* Revoke setgid privileges */ + setregid(getgid(), getgid()); + while ((ch = getopt(argc, argv, "r:o:")) != -1) switch(ch) { case 'o': { @@ -162,7 +165,7 @@ main(argc, argv) /* Handle interrupt character. Print score and exit. */ void intr(dummy) - int dummy; + int dummy __attribute__((__unused__)); { showstats(); exit(0); |