diff options
author | christos <christos@NetBSD.org> | 2020-11-11 17:11:19 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 2020-11-11 17:11:19 +0000 |
commit | 6eff467615806d8dd5a8bac71bad4e5ca27b5c84 (patch) | |
tree | 3167d99c7ca36002ff9d62b7db669cd5e57179b8 /warp/score.c | |
parent | 38b99ae599004d14655eba19a5dd4304366aa9c5 (diff) | |
download | bsdgames-darwin-6eff467615806d8dd5a8bac71bad4e5ca27b5c84.tar.gz bsdgames-darwin-6eff467615806d8dd5a8bac71bad4e5ca27b5c84.tar.zst bsdgames-darwin-6eff467615806d8dd5a8bac71bad4e5ca27b5c84.zip |
- use termios
- enable setgid games
- enable savedir
Diffstat (limited to 'warp/score.c')
-rw-r--r-- | warp/score.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/warp/score.c b/warp/score.c index 16272669..3736f4a3 100644 --- a/warp/score.c +++ b/warp/score.c @@ -35,20 +35,18 @@ score_init(void) int i; FILE *savfil; -#if 0 if (stat(SAVEDIR,&filestat)) { printf("Cannot access %s\r\n",SAVEDIR); finalize(1); } - if (filestat.st_uid != geteuid()) { - printf("Warp will not run right without being setuid.\r\n"); + if (filestat.st_gid != getegid()) { + printf("Warp will not run right without being setgid.\r\n"); finalize(1); } if ((filestat.st_mode & 0605) != 0605) { printf("%s is not protected correctly (must be u+rw o+rx).\r\n",SAVEDIR); finalize(1); } -#endif #ifdef SCOREFULL interp(longlognam, sizeof longlognam, "%N"); @@ -241,9 +239,7 @@ wscore(void) printf("WHO SCORE DF CDF E B WV FLAGS\r\n"); resetty(); snprintf(spbuf, sizeof(spbuf), "/bin/cat %ssave.*",SAVEDIR); -#ifndef lint execl("/bin/sh", "sh", "-c", spbuf, NULL); -#endif finalize(1); } @@ -421,10 +417,8 @@ wavescore(void) snprintf(spbuf, sizeof(spbuf), "Star save ratio: %1.8f (%d/%d)", starscore, numstars, inumstars); mvaddstr( 6,5, spbuf); -#ifndef lint bonuses += tmp = (long) (((double)curscore / possiblescore) * (starscore*starscore) * smarts * 20); -#endif snprintf(spbuf, sizeof(spbuf), "%6ld", tmp); mvaddstr( 6, 68, spbuf); row = 7; |