# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ DESCRIPTION="detects and handles buffer overflow and format string vulnerabilities on \ existing libc6 programs" HOMEPAGE="http://www.research.avayalabs.com/project/libsafe/index.html" MY_P="${PN}-${PV%.*}-${PV##*.}" SRC_URI="http://www.research.avayalabs.com/project/libsafe/src/${MY_P}.tgz" LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~x86" # mta - maybe later IUSE="" DEPEND="virtual/glibc" #RDEPEND="${DEPEND}" S=${WORKDIR}/${MY_P} src_compile() { # Note email notification currently not implimented in this ebuild # due to I cannot work out if a mta is on localhost:25 for it. # It safer not too assume it is. Uncomment the following if desired #mv src/Makefile src/Makefile.orig #sed "s:^CCFLAGS..=:CCFLAGS=-DNOTIFY_WITH_EMAIL:" src/Makefile.orig > \ # src/Makefile # I tried the following and it failed to match the pattern. #dosed "s:^CCFLAGS..=:CCFLAGS=-DNOTIFY_WITH_EMAIL:" src/Makefile emake || die } src_install() { # libsafe stuff into / dolib.so src/libsafe.so.${PV/a/} || die dodir /lib dosym libsafe.so.${PV/a/} /lib/libsafe.so || die # exploits (for testing) exeinto /usr/lib/libsafe doexe `find exploits -type f -perm +111` # Documentation doman libsafe.8 dodoc COPYING EMAIL_NOTIFICATION LIBPRELUDE README INSTALL newdoc exploits/README README.exploits dohtml doc/libsafe.8.html docinto whitepaper-1.3 dodoc doc/whitepaper-1.3/* docinto whitepaper-2.0 dodoc doc/whitepaper-2.0/* einfo "Sample exploits of bufferflow are included in /usr/lib/libsafe for testing" } pkg_postinst() { if [ -z `grep "^/lib/libsafe.so" /etc/ld.so.preload` ] ; then echo "/lib/libsafe.so" >> /etc/ld.so.preload fi } pkg_prerm() { cp /etc/ld.so.preload ${T} grep -v libsafe ${T}/ld.so.preload > /etc/ld.so.preload }