mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 15:38:06 +01:00
Installed scenarios was unreadable with change games uid->gid, fix it
Beforeinstall score file to the right place Use srandomdev Remove revoke, it broke scores and scenarios Fix names in FILES manpage section
This commit is contained in:
parent
e795ad69b6
commit
98b6c02f5c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29761
@ -7,12 +7,14 @@ SRCS= extern.c grammar.c graphics.c input.c lex.c list.c log.c \
|
|||||||
MAN6= atc.6
|
MAN6= atc.6
|
||||||
DPADD= ${LIBL} ${LIBM} ${LIBCURSES} ${LIBTERMCAP} ${LIBCOMPAT}
|
DPADD= ${LIBL} ${LIBM} ${LIBCURSES} ${LIBTERMCAP} ${LIBCOMPAT}
|
||||||
LDADD= -ll -lm -lcurses -ltermcap -lcompat
|
LDADD= -ll -lm -lcurses -ltermcap -lcompat
|
||||||
GAMES= ATC_scores Game_List Killer crossover default easy game_2
|
GAMES= Game_List Killer crossover default easy game_2
|
||||||
CLEANFILES=grammar.c y.tab.h lex.c
|
CLEANFILES=grammar.c y.tab.h lex.c
|
||||||
HIDEGAME=hidegame
|
HIDEGAME=hidegame
|
||||||
|
|
||||||
beforeinstall:
|
beforeinstall:
|
||||||
(cd ${.CURDIR}/games; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 400 \
|
(cd ${.CURDIR}/games; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 440 \
|
||||||
${GAMES} ${DESTDIR}${SHAREDIR}/games/atc)
|
${GAMES} ${DESTDIR}${SHAREDIR}/games/atc)
|
||||||
|
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 ${.CURDIR}/games/ATC_scores \
|
||||||
|
${DESTDIR}/var/games/atc_score
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -576,11 +576,9 @@ line: [ ( 1 1 ) ( 6 6 ) ]
|
|||||||
Files are kept in a special directory. See the OPTIONS for a way to
|
Files are kept in a special directory. See the OPTIONS for a way to
|
||||||
print this path out.
|
print this path out.
|
||||||
.TP 16
|
.TP 16
|
||||||
.B ATC_score
|
/var/games/atc_score Where the scores are kept.
|
||||||
Where the scores are kept.
|
|
||||||
.TP 16
|
.TP 16
|
||||||
.B Game_List
|
/usr/share/games/atc/Game_List The list of playable games.
|
||||||
The list of playable games.
|
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
.LP
|
.LP
|
||||||
Ed James, UC Berkeley: edjames@ucbvax.berkeley.edu, ucbvax!edjames
|
Ed James, UC Berkeley: edjames@ucbvax.berkeley.edu, ucbvax!edjames
|
||||||
|
@ -100,7 +100,7 @@ log_score(list_em)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
umask(0);
|
umask(0);
|
||||||
fd = open(_PATH_SCORE, O_CREAT|O_RDWR, 0644);
|
fd = open(_PATH_SCORE, O_CREAT|O_RDWR, 0664);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
perror(_PATH_SCORE);
|
perror(_PATH_SCORE);
|
||||||
return (-1);
|
return (-1);
|
||||||
|
@ -59,7 +59,7 @@ static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
|
|||||||
main(ac, av)
|
main(ac, av)
|
||||||
char *av[];
|
char *av[];
|
||||||
{
|
{
|
||||||
int seed;
|
int seed = 0;
|
||||||
int f_usage = 0, f_list = 0, f_showscore = 0;
|
int f_usage = 0, f_list = 0, f_showscore = 0;
|
||||||
int f_printpath = 0;
|
int f_printpath = 0;
|
||||||
char *file = NULL;
|
char *file = NULL;
|
||||||
@ -70,11 +70,7 @@ main(ac, av)
|
|||||||
extern char *default_game(), *okay_game();
|
extern char *default_game(), *okay_game();
|
||||||
extern void log_score(), quit(), update();
|
extern void log_score(), quit(), update();
|
||||||
|
|
||||||
/* revoke privs */
|
start_time = time(0);
|
||||||
setegid(getgid());
|
|
||||||
setgid(getgid());
|
|
||||||
|
|
||||||
start_time = seed = time(0);
|
|
||||||
|
|
||||||
name = *av++;
|
name = *av++;
|
||||||
while (*av) {
|
while (*av) {
|
||||||
@ -102,7 +98,8 @@ main(ac, av)
|
|||||||
f_printpath++;
|
f_printpath++;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
seed = atoi(*av);
|
srandom(atoi(*av));
|
||||||
|
seed = 1;
|
||||||
av++;
|
av++;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
@ -119,7 +116,8 @@ main(ac, av)
|
|||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
srandom(seed);
|
if (!seed)
|
||||||
|
srandomdev();
|
||||||
|
|
||||||
if (f_usage)
|
if (f_usage)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
Loading…
Reference in New Issue
Block a user