summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sterrett <mr_bones_@gentoo.org>2008-04-26 15:50:35 +0000
committerMichael Sterrett <mr_bones_@gentoo.org>2008-04-26 15:50:35 +0000
commitb1ffebea044dbbd922d43cfe79406f14e68faf41 (patch)
treed2295235f3811e63cb6a4d87833cd188b160370c /eclass/games.eclass
parentActually do the removal. (diff)
downloadgentoo-2-b1ffebea044dbbd922d43cfe79406f14e68faf41.tar.gz
gentoo-2-b1ffebea044dbbd922d43cfe79406f14e68faf41.tar.bz2
gentoo-2-b1ffebea044dbbd922d43cfe79406f14e68faf41.zip
Make sure only files in GAMES_STATEDIR are writable.
Diffstat (limited to 'eclass/games.eclass')
-rw-r--r--eclass/games.eclass8
1 files changed, 5 insertions, 3 deletions
diff --git a/eclass/games.eclass b/eclass/games.eclass
index c2f727e800aa..d8ab7d1c8d94 100644
--- a/eclass/games.eclass
+++ b/eclass/games.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/games.eclass,v 1.124 2008/02/15 00:15:51 nyhm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/games.eclass,v 1.125 2008/04/26 15:50:35 mr_bones_ Exp $
# devlist: {vapier,wolf31o2,mr_bones_}@gentoo.org -> games@gentoo.org
#
@@ -82,7 +82,7 @@ games_make_wrapper() { gameswrapper ${FUNCNAME/games_} "$@"; }
gamesowners() { chown ${GAMES_USER}:${GAMES_GROUP} "$@"; }
gamesperms() { chmod u+rw,g+r-w,o-rwx "$@"; }
prepgamesdirs() {
- local dir f
+ local dir f mode
for dir in \
"${GAMES_PREFIX}" "${GAMES_PREFIX_OPT}" "${GAMES_DATADIR}" \
"${GAMES_SYSCONFDIR}" "${GAMES_STATEDIR}" "$(games_get_libdir)" \
@@ -92,7 +92,9 @@ prepgamesdirs() {
(
gamesowners -R "${D}/${dir}"
find "${D}/${dir}" -type d -print0 | xargs -0 chmod 750
- find "${D}/${dir}" -type f -print0 | xargs -0 chmod o-rwx,g+r
+ mode=o-rwx,g+r,g-w
+ [[ ${dir} = ${GAMES_STATEDIR} ]] && mode=o-rwx,g+r
+ find "${D}/${dir}" -type f -print0 | xargs -0 chmod $mode
) &>/dev/null
f=$(find "${D}/${dir}" -perm +4000 -a -uid 0 2>/dev/null)
if [[ -n ${f} ]] ; then