summaryrefslogtreecommitdiffstats
path: root/games/backgammon
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-09-24 06:39:23 +0000
committerache <ache@FreeBSD.org>1997-09-24 06:39:23 +0000
commit369ad2ce736f173c529cebe6f26bb6e6ea7d457b (patch)
tree46feb131b5eb3682e5a8a3d360efcf66e220cc5e /games/backgammon
parent904e937fbce1e5033a6d76fd0ba8dcacc2e49cad (diff)
downloadFreeBSD-src-369ad2ce736f173c529cebe6f26bb6e6ea7d457b.zip
FreeBSD-src-369ad2ce736f173c529cebe6f26bb6e6ea7d457b.tar.gz
Cleanup
Simplify revoke: only sgid needed to be revoked Use srandomdev
Diffstat (limited to 'games/backgammon')
-rw-r--r--games/backgammon/backgammon/main.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/games/backgammon/backgammon/main.c b/games/backgammon/backgammon/main.c
index 270e1f5..700cfcb 100644
--- a/games/backgammon/backgammon/main.c
+++ b/games/backgammon/backgammon/main.c
@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#include <stdio.h>
#include <unistd.h>
#include <string.h>
+#include <stdlib.h>
#include "back.h"
#define MVPAUSE 5 /* time to sleep when stuck */
@@ -103,16 +104,9 @@ char **argv;
register int i; /* non-descript index */
register int l; /* non-descript index */
register char c; /* non-descript character storage */
- long t; /* time for random num generator */
- uid_t uid;
-
- /*Drop the privilege.*/
- uid = getuid();
- setreuid (uid,uid);
/* revoke privs */
setegid(getgid());
- setgid(getgid());
/* initialization */
bflag = 2; /* default no board */
@@ -147,8 +141,7 @@ char **argv;
* for text */
if (tflag)
begscr = 0;
- t = time(0);
- srandom(t); /* 'random' seed */
+ srandomdev();
getarg (argc, argv);
args[acnt] = NULL;
@@ -186,7 +179,7 @@ char **argv;
tflag = 0; /* error! */
writel (noteach);
- exit();
+ exit(1);
} else { /* if not rules, then
* instructions */
writel (need);
OpenPOWER on IntegriCloud