NetBSD Problem Report #42045

From www@NetBSD.org  Fri Sep 11 01:09:55 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 9ABB263BC1D
	for <gnats-bugs@gnats.netbsd.org>; Fri, 11 Sep 2009 01:09:55 +0000 (UTC)
Message-Id: <20090911010955.5E24E63B877@www.NetBSD.org>
Date: Fri, 11 Sep 2009 01:09:55 +0000 (UTC)
From: joachim.kuebart@gmx.net
Reply-To: joachim.kuebart@gmx.net
To: gnats-bugs@NetBSD.org
Subject: Set correct file permissions when games/gnome-games is installed with USE_DESTDIR
X-Send-Pr-Version: www-1.0

>Number:         42045
>Category:       pkg
>Synopsis:       Set correct file permissions when games/gnome-games is installed with USE_DESTDIR
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dholland
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 11 01:10:06 +0000 2009
>Last-Modified:  Tue Sep 15 06:55:01 +0000 2009
>Originator:     Joachim Kuebart
>Release:        NetBSD-current
>Organization:
>Environment:
NetBSD yacht 5.99.16 NetBSD 5.99.16 (YACHT) #2: Thu Sep 10 10:16:00 BST 2009  joki@yacht:/usr/obj/amd64/usr/src/sys/arch/amd64/compile/YACHT amd64

>Description:
When games/gnome-games is built with USE_DESTDIR=yes, the game binaries aren't installed setguid games and the score files are incorrectly installed with user=root and group=wheel into /var/games. This means that players cannot store high scores.
>How-To-Repeat:
Build and install games/gnome-games using USE_DESTDIR=yes.
Binaries are not installed as setguid "games" in /usr/pkg/bin, and score files are installed with user=root and group=wheel into /var/games.
>Fix:
The following patch uses SETGAMEGID, SPECIAL_PERMS and
SETGID_GAMES_PERMS to set the permissions of 10 binaries and 87 score files correctly.


Index: Makefile
===================================================================
RCS file: /pub/NetBSD-CVS/pkgsrc/games/gnome-games/Makefile,v
retrieving revision 1.102
diff -p -U8 -r1.102 Makefile
--- Makefile	26 Aug 2009 19:57:30 -0000	1.102
+++ Makefile	11 Sep 2009 00:58:29 -0000
@@ -48,16 +48,88 @@ GCONF_SCHEMAS+=	gtali.schemas
 GCONF_SCHEMAS+=	iagno.schemas
 GCONF_SCHEMAS+=	mahjongg.schemas
 GCONF_SCHEMAS+=	same-gnome.schemas

 PYTHON_PATCH_SCRIPTS+=	glchess/src/glchess.in.in
 PYTHON_PATCH_SCRIPTS+=	gnome-sudoku/src/gnome-sudoku.in.in
 PY_PATCHPLIST=		yes

+SETGIDGAME=		yes
+T=			share/gnome-games/scorefile-templates
+M=			${GAMES_USER} ${GAMES_GROUP} ${GAMEDATAMODE}
+SPECIAL_PERMS+=		bin/glines ${SETGID_GAMES_PERMS} \
+			bin/gnibbles ${SETGID_GAMES_PERMS} \
+			bin/gnobots2 ${SETGID_GAMES_PERMS} \
+			bin/gnometris ${SETGID_GAMES_PERMS} \
+			bin/gnomine ${SETGID_GAMES_PERMS} \
+			bin/gnotravex ${SETGID_GAMES_PERMS} \
+			bin/gnotski ${SETGID_GAMES_PERMS} \
+			bin/gtali ${SETGID_GAMES_PERMS} \
+			bin/mahjongg ${SETGID_GAMES_PERMS} \
+			bin/same-gnome ${SETGID_GAMES_PERMS} \
+			$T/glines.Large.scores $M $T/glines.Medium.scores $M \
+			$T/glines.Small.scores $M $T/gnibbles.1.0.scores $M \
+			$T/gnibbles.1.1.scores $M $T/gnibbles.2.0.scores $M \
+			$T/gnibbles.2.1.scores $M $T/gnibbles.3.0.scores $M \
+			$T/gnibbles.3.1.scores $M $T/gnibbles.4.0.scores $M \
+			$T/gnibbles.4.1.scores $M \
+			$T/gnobots2.classic_robots-safe.scores $M \
+			$T/gnobots2.classic_robots-super-safe.scores $M \
+			$T/gnobots2.classic_robots.scores $M \
+			$T/gnobots2.nightmare-safe.scores $M \
+			$T/gnobots2.nightmare-super-safe.scores $M \
+			$T/gnobots2.nightmare.scores $M \
+			$T/gnobots2.robots2-safe.scores $M \
+			$T/gnobots2.robots2-super-safe.scores $M \
+			$T/gnobots2.robots2.scores $M \
+			$T/gnobots2.robots2_easy-safe.scores $M \
+			$T/gnobots2.robots2_easy-super-safe.scores $M \
+			$T/gnobots2.robots2_easy.scores $M \
+			$T/gnobots2.robots_with_safe_teleport-safe.scores $M \
+			$T/gnobots2.robots_with_safe_teleport-super-safe.scores $M \
+			$T/gnobots2.robots_with_safe_teleport.scores $M \
+			$T/gnometris.scores $M $T/gnomine.Custom.scores $M \
+			$T/gnomine.Large.scores $M $T/gnomine.Medium.scores $M \
+			$T/gnomine.Small.scores $M $T/gnotravex.2x2.scores $M \
+			$T/gnotravex.3x3.scores $M $T/gnotravex.4x4.scores $M \
+			$T/gnotravex.5x5.scores $M $T/gnotravex.6x6.scores $M \
+			$T/gnotski.1.scores $M $T/gnotski.10.scores $M \
+			$T/gnotski.11.scores $M $T/gnotski.12.scores $M \
+			$T/gnotski.13.scores $M $T/gnotski.14.scores $M \
+			$T/gnotski.15.scores $M $T/gnotski.16.scores $M \
+			$T/gnotski.17.scores $M $T/gnotski.18.scores $M \
+			$T/gnotski.19.scores $M $T/gnotski.2.scores $M \
+			$T/gnotski.20.scores $M $T/gnotski.21.scores $M \
+			$T/gnotski.22.scores $M $T/gnotski.23.scores $M \
+			$T/gnotski.24.scores $M $T/gnotski.25.scores $M \
+			$T/gnotski.26.scores $M $T/gnotski.27.scores $M \
+			$T/gnotski.28.scores $M $T/gnotski.29.scores $M \
+			$T/gnotski.3.scores $M $T/gnotski.30.scores $M \
+			$T/gnotski.31.scores $M $T/gnotski.32.scores $M \
+			$T/gnotski.33.scores $M $T/gnotski.34.scores $M \
+			$T/gnotski.35.scores $M $T/gnotski.36.scores $M \
+			$T/gnotski.37.scores $M $T/gnotski.4.scores $M \
+			$T/gnotski.5.scores $M $T/gnotski.6.scores $M \
+			$T/gnotski.7.scores $M $T/gnotski.8.scores $M \
+			$T/gnotski.9.scores $M $T/gtali.Colors.scores $M \
+			$T/gtali.Regular.scores $M \
+			$T/mahjongg.bridges.scores $M \
+			$T/mahjongg.cloud.scores $M \
+			$T/mahjongg.confounding.scores $M \
+			$T/mahjongg.difficult.scores $M \
+			$T/mahjongg.dragon.scores $M \
+			$T/mahjongg.easy.scores $M \
+			$T/mahjongg.pyramid.scores $M \
+			$T/mahjongg.tictactoe.scores $M \
+			$T/mahjongg.ziggurat.scores $M \
+			$T/same-gnome.Large.scores $M \
+			$T/same-gnome.Medium.scores $M \
+			$T/same-gnome.Small.scores $M
+
 .include "../../devel/GConf/schemas.mk"
 .include "../../devel/GConf-ui/buildlink3.mk"
 .include "../../devel/gettext-lib/buildlink3.mk"
 BUILDLINK_API_DEPENDS.glib2+=	glib2>=2.6.3
 .include "../../devel/glib2/buildlink3.mk"
 .include "../../devel/libglade/buildlink3.mk"
 BUILDLINK_API_DEPENDS.libgnome+=	libgnome>=2.10.0
 .include "../../devel/libgnome/buildlink3.mk"

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->dholland
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Tue, 15 Sep 2009 06:55:01 +0000
Responsible-Changed-Why:
take.
it's high time someone fixed up setgid handling for games, and I keep
mumbling about it and might as well do it...


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.