diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-01-25 03:12:18 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2013-01-25 03:12:18 +0000 |
commit | d0aca3dd055d791508028f3ca6a7a381dc067c36 (patch) | |
tree | 3c59eb3553c356d5f9e1a56f02c5e31bf3b56645 /sys-libs | |
parent | vanilla-3.7.3 + genpatches-3.7-5 + grsecurity-2.9.1-3.7.4-201301230048 (diff) | |
download | gentoo-2-d0aca3dd055d791508028f3ca6a7a381dc067c36.tar.gz gentoo-2-d0aca3dd055d791508028f3ca6a7a381dc067c36.tar.bz2 gentoo-2-d0aca3dd055d791508028f3ca6a7a381dc067c36.zip |
Refactor sanity checks a bit and include gcc in the search path #453760 by William Throwe.
(Portage version: 2.2.0_alpha159/cvs/Linux x86_64, signed Manifest commit with key FB7C4156)
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/glibc/ChangeLog | 7 | ||||
-rw-r--r-- | sys-libs/glibc/files/eblits/pkg_preinst.eblit | 59 |
2 files changed, 40 insertions, 26 deletions
diff --git a/sys-libs/glibc/ChangeLog b/sys-libs/glibc/ChangeLog index 580f2d5b8e55..70a32aa9e903 100644 --- a/sys-libs/glibc/ChangeLog +++ b/sys-libs/glibc/ChangeLog @@ -1,5 +1,10 @@ # ChangeLog for sys-libs/glibc -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.919 2013/01/23 05:27:59 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.920 2013/01/25 03:12:18 vapier Exp $ + + 25 Jan 2013; Mike Frysinger <vapier@gentoo.org> + files/eblits/pkg_preinst.eblit: + Refactor sanity checks a bit and include gcc in the search path #453760 by + William Throwe. 23 Jan 2013; Mike Frysinger <vapier@gentoo.org> glibc-2.16.0.ebuild, glibc-2.17.ebuild: diff --git a/sys-libs/glibc/files/eblits/pkg_preinst.eblit b/sys-libs/glibc/files/eblits/pkg_preinst.eblit index bb1032ddcb03..3475415ea325 100644 --- a/sys-libs/glibc/files/eblits/pkg_preinst.eblit +++ b/sys-libs/glibc/files/eblits/pkg_preinst.eblit @@ -1,6 +1,37 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_preinst.eblit,v 1.6 2012/10/02 07:12:17 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_preinst.eblit,v 1.7 2013/01/25 03:12:18 vapier Exp $ + +# Simple test to make sure our new glibc isnt completely broken. +# Make sure we don't test with statically built binaries since +# they will fail. Also, skip if this glibc is a cross compiler. +glibc_sanity_check() { + cd / #228809 + + # We also might have to search the gcc dir for things like libgcc_s.so #453760 + local gccdir=$(ls -1rd /usr/lib/gcc/${CHOST}/*/ | head -1) + + # We enter ${D} so to avoid trouble if the path contains + # special characters; for instance if the path contains the + # colon character (:), then the linker will try to split it + # and look for the libraries in an unexpected place. This can + # lead to unsafe code execution if the generated prefix is + # within a world-writable directory. + # (e.g. /var/tmp/portage:${HOSTNAME}) + pushd "${D}"/$(get_libdir) >/dev/null + + local x striptest + for x in date env ls true uname ; do + x=$(type -p ${x}) + [[ -z ${x} ]] && continue + striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) || continue + [[ ${striptest} == *"statically linked"* ]] && continue + ./ld-*.so --library-path ".:${gccdir}" ${x} > /dev/null \ + || die "simple run test (${x}) failed" + done + + popd >/dev/null +} eblit-glibc-pkg_preinst() { # nothing to do if just installing headers @@ -15,29 +46,7 @@ eblit-glibc-pkg_preinst() { elog "Defaulting /etc/host.conf:multi to on" fi - # simple test to make sure our new glibc isnt completely broken. - # make sure we don't test with statically built binaries since - # they will fail. also, skip if this glibc is a cross compiler. [[ ${ROOT} != "/" ]] && return 0 [[ -d ${D}/$(get_libdir) ]] || return 0 - cd / #228809 - local x striptest - for x in date env ls true uname ; do - x=$(type -p ${x}) - [[ -z ${x} ]] && continue - striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) - [[ -z ${striptest} ]] && continue - [[ ${striptest} == *"statically linked"* ]] && continue - # we enter ${D} so to avoid trouble if the path contains - # special characters; for instance if the path contains the - # colon character (:), then the linker will try to split it - # and look for the libraries in an unexpected place. This can - # lead to unsafe code execution if the generated prefix is - # within a world-writable directory - # (e.g. /var/tmp/portage:${HOSTNAME}) - pushd "${D}"/$(get_libdir) 2>/dev/null - ./ld-*.so --library-path . ${x} > /dev/null \ - || die "simple run test (${x}) failed" - popd 2>/dev/null - done + glibc_sanity_check } |