games: Mark utilities that write to /var/games/ directory.
authorzrj <rimvydas.jasinskas@gmail.com>
Sat, 22 Jul 2017 12:14:59 +0000 (15:14 +0300)
committerzrj <zrj@dragonflybsd.org>
Sat, 11 Nov 2017 15:29:30 +0000 (17:29 +0200)
Make them available for users in games group only.
This will allow to tighten security a bit.

While there, add missing creation of /var/games/atc_score.

12 files changed:
games/Makefile.inc
games/atc/Makefile
games/battlestar/Makefile
games/canfield/canfield/Makefile
games/cribbage/Makefile
games/hack/Makefile
games/larn/Makefile
games/phantasia/Makefile
games/robots/Makefile
games/rogue/Makefile
games/sail/Makefile
games/snake/snake/Makefile

index 17c5ea6..3fd5150 100644 (file)
@@ -1,11 +1,16 @@
 #      @(#)Makefile.inc        8.1 (Berkeley) 5/31/93
 # $FreeBSD: src/games/Makefile.inc,v 1.10.2.2 2002/02/18 16:02:39 ru Exp $
-# $DragonFly: src/games/Makefile.inc,v 1.3 2006/10/08 16:22:34 pavalos Exp $
 
 BINDIR?=       /usr/games
 FILESDIR?=     ${SHAREDIR}/games
 WARNS?=                6
 
+# These games write to /var/games/
+.if defined(VARGAMES)
+BINGRP=                games
+BINMODE=       550
+.endif
+
 .if defined(HIDEGAME)
 ORIGBINDIR:=   ${BINDIR}
 BINDIR:=       ${BINDIR}/hide
index cbc116a..ff983a3 100644 (file)
@@ -16,6 +16,14 @@ FILES=               Game_List Killer crossover default easy game_2
 FILESDIR=      ${SHAREDIR}/games/atc
 .endif
 
+VARGAMES=      yes
+
+beforeinstall:
+.if !exists(${DESTDIR}/var/games/atc_score)
+       ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
+           ${DESTDIR}/var/games/atc_score
+.endif
+
 .PATH: ${.CURDIR}/games
 
 .include <bsd.prog.mk>
index 9ea08f3..8f38c00 100644 (file)
@@ -13,6 +13,8 @@ LDADD=        -lprivate_ncurses
 CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
 LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
 
+VARGAMES=      yes
+
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/battlestar.log)
        ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
index 4bf99ba..dd090bd 100644 (file)
@@ -10,6 +10,8 @@ LDADD=        -lprivate_ncurses
 CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
 LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
 
+VARGAMES=      yes
+
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/cfscores)
        ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
index 1e68874..30fb5bd 100644 (file)
@@ -15,6 +15,8 @@ FILESNAME_cribbage.n= cribbage.instr
 .endif
 MAN=   cribbage.6
 
+VARGAMES=      yes
+
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/criblog)
        ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
index d98b670..6081293 100644 (file)
@@ -29,6 +29,8 @@ FILESDIR=     /var/games/hackdir
 CLEANFILES=    hack.onames.h makedefs.nx makedefs.no
 NO_STRICT_ALIASING=
 
+VARGAMES=      yes
+
 build-tools: makedefs.nx
 
 hack.onames.h: makedefs.nx def.objects.h
index 7423136..373163a 100644 (file)
@@ -59,6 +59,8 @@ FILES=                larnmaze larnopts larn.help
 FILESDIR=      ${SHAREDIR}/games/larn
 .endif
 
+VARGAMES=      yes
+
 .PATH: ${.CURDIR}/datfiles
 
 beforeinstall:
index df1dab2..19029d0 100644 (file)
@@ -11,6 +11,8 @@ CFLAGS+=      -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
 LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
 
 NXLDLIBS=      -lm
+
+VARGAMES=      yes
 DATAFILES=     characs gold lastdead mess monsters motd scoreboard void
 CLEANFILES=    ${DATAFILES} cross-phantglobs.no map setup.nx setup.no \
                stamp.setuprun
index 9440796..bf0ad96 100644 (file)
@@ -12,6 +12,8 @@ LDADD=        -lprivate_ncurses
 CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
 LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
 
+VARGAMES=      yes
+
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/robots_roll)
        ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
index 4164716..1c3d1d3 100644 (file)
@@ -13,6 +13,8 @@ CFLAGS+=      -DUNIX
 CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
 LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
 
+VARGAMES=      yes
+
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/rogue.scores)
        ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
index e5835a3..ee640a7 100644 (file)
@@ -12,6 +12,8 @@ LDADD=        -lprivate_ncurses
 CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
 LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
 
+VARGAMES=      yes
+
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/saillog)
        ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
index 6da6dbe..f568f1b 100644 (file)
@@ -11,6 +11,8 @@ LDADD=        -lm -lprivate_ncurses
 CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
 LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
 
+VARGAMES=      yes
+
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/snakerawscores)
        ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \