summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-04-05 03:38:14 +0000
committerMike Frysinger <vapier@gentoo.org>2009-04-05 03:38:14 +0000
commite411f84ee4df0ccc494696f3ccd7de9f6c0f64eb (patch)
tree9a0bcc3b2523635e4b104fa8a34166cf26bb4457
parentMake sure the id files are world readable #264812 by Redeeman. (diff)
downloadgentoo-2-e411f84ee4df0ccc494696f3ccd7de9f6c0f64eb.tar.gz
gentoo-2-e411f84ee4df0ccc494696f3ccd7de9f6c0f64eb.tar.bz2
gentoo-2-e411f84ee4df0ccc494696f3ccd7de9f6c0f64eb.zip
make sure we dont set common dirs like /opt/bin and /opt/lib to games owner #264872 by Kris Scott
-rw-r--r--eclass/games.eclass13
1 files changed, 12 insertions, 1 deletions
diff --git a/eclass/games.eclass b/eclass/games.eclass
index 7c6d01be5d66..e36044a54371 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.135 2009/03/08 13:24:49 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/games.eclass,v 1.136 2009/04/05 03:38:14 vapier Exp $
# devlist: {vapier,wolf31o2,mr_bones_}@gentoo.org -> games@gentoo.org
#
@@ -85,7 +85,18 @@ prepgamesdirs() {
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
+
+ # common trees should not be games owned #264872
+ if [[ ${dir} == "${GAMES_PREFIX_OPT}" ]] ; then
+ fowners root:root "${dir}"
+ fperms 755 "${dir}"
+ for d in $(get_libdir) bin ; do
+ fowners root:root "${dir}/${d}"
+ fperms 755 "${dir}/${d}"
+ done
+ fi
) &>/dev/null
+
f=$(find "${D}/${dir}" -perm +4000 -a -uid 0 2>/dev/null)
if [[ -n ${f} ]] ; then
eerror "A game was detected that is setuid root!"