From 6ba4f5b629a1e69db00d002135f6262ddd0a3a5a Mon Sep 17 00:00:00 2001 From: pho Date: Wed, 8 Jan 2020 16:55:13 +0000 Subject: Set a setuid bit on bin/recover too Also corrected the default directory where bin/recover searches for save files. --- games/nethack-lib/Makefile | 8 +++++++- games/nethack-lib/distinfo | 3 ++- games/nethack-lib/patches/patch-util_recover.c | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 games/nethack-lib/patches/patch-util_recover.c (limited to 'games') diff --git a/games/nethack-lib/Makefile b/games/nethack-lib/Makefile index 45513e7529a..417bf875ddc 100644 --- a/games/nethack-lib/Makefile +++ b/games/nethack-lib/Makefile @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.32 2019/10/24 11:51:23 pho Exp $ +# $NetBSD: Makefile,v 1.33 2020/01/08 16:55:13 pho Exp $ # .include "../../games/nethack-lib/Makefile.common" PKGNAME= nethack-lib-${NETHACK_VERSION} +PKGREVISION= 1 COMMENT= Data files for Nethack @@ -47,4 +48,9 @@ CHECK_FILES_SKIP+= ${VARDIR}/logfile \ ${VARDIR}/xlogfile \ ${HACKDIR}/sysconf +# Like bin/nethack-*, bin/recover also has to operate on save files +# owned by ${NETHACK_USER}:${NETHACK_GROUP}. This means bin/recover +# can only work when it's setuid'ed to that user/group. +SPECIAL_PERMS+= ${PREFIX}/bin/recover ${GAMEPERM} + .include "../../mk/bsd.pkg.mk" diff --git a/games/nethack-lib/distinfo b/games/nethack-lib/distinfo index c1113a41c75..a24fc198032 100644 --- a/games/nethack-lib/distinfo +++ b/games/nethack-lib/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.24 2019/12/19 14:41:59 rhialto Exp $ +$NetBSD: distinfo,v 1.25 2020/01/08 16:55:13 pho Exp $ SHA1 (nethack-364-src.tgz) = e8166806a65893d7b843718c37b8aa9e87cfcef1 RMD160 (nethack-364-src.tgz) = 0af138fd481e6359f265d85423a36a160692dc92 @@ -14,3 +14,4 @@ SHA1 (patch-sys_unix_Makefile.src) = 35eabd1ca5577988e48daf10835dfa335f7e67ac SHA1 (patch-sys_unix_Makefile.top) = 0736aafda67dec45657f9f15338ce2f89add9747 SHA1 (patch-sys_unix_Makefile.utl) = 142f267fdd9a94c212657b7242dea6a3716c738e SHA1 (patch-sys_unix_nethack.sh) = eec4b6619584d7e07ac5d9a086af9bc8f7e6285f +SHA1 (patch-util_recover.c) = 60e5ec35313a97cf788ff1ed4a4772bbcf24bc48 diff --git a/games/nethack-lib/patches/patch-util_recover.c b/games/nethack-lib/patches/patch-util_recover.c new file mode 100644 index 00000000000..0309268ffdc --- /dev/null +++ b/games/nethack-lib/patches/patch-util_recover.c @@ -0,0 +1,19 @@ +$NetBSD: patch-util_recover.c,v 1.1 2020/01/08 16:55:13 pho Exp $ + +The directory where save files are located is defined as +VAR_PLAYGROUND. HACKDIR only has static files. + +--- util/recover.c.orig 2020-01-08 16:49:06.924084164 +0000 ++++ util/recover.c +@@ -121,9 +121,9 @@ char *argv[]; + } + #endif /* SECURE && !VMS */ + +-#ifdef HACKDIR ++#ifdef VAR_PLAYGROUND + if (!dir) +- dir = HACKDIR; ++ dir = VAR_PLAYGROUND; + #endif + + #ifdef AMIGA -- cgit v1.2.3