summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Phillip Brink <binki@gentoo.org>2011-10-30 04:58:01 +0000
committerNathan Phillip Brink <binki@gentoo.org>2011-10-30 04:58:01 +0000
commit212959d16a90e7a711f40fa18922a45d139dbc10 (patch)
treef2a10c2faadc4ab35cd3a3b06bffbeeb99d6184b /sys-power/cpufreqd
parentVersion bump. (diff)
downloadgentoo-2-212959d16a90e7a711f40fa18922a45d139dbc10.tar.gz
gentoo-2-212959d16a90e7a711f40fa18922a45d139dbc10.tar.bz2
gentoo-2-212959d16a90e7a711f40fa18922a45d139dbc10.zip
Add patch from bug #318287 by Sven Eden <yamakuzure@gmx.net> fixing glibc abort() for potential buffer overflow on startup when compiled with gcc-4.5 and CFLAGS="-O1" and passed the -f flag. OKed by steev_.
(Portage version: 2.2.0_alpha71-r1/cvs/Linux x86_64)
Diffstat (limited to 'sys-power/cpufreqd')
-rw-r--r--sys-power/cpufreqd/ChangeLog12
-rw-r--r--sys-power/cpufreqd/cpufreqd-2.4.2-r1.ebuild84
-rw-r--r--sys-power/cpufreqd/files/cpufreqd-2.4.2-PATH_MAX.patch19
3 files changed, 113 insertions, 2 deletions
diff --git a/sys-power/cpufreqd/ChangeLog b/sys-power/cpufreqd/ChangeLog
index 4e4d488798d4..bae3e63b276e 100644
--- a/sys-power/cpufreqd/ChangeLog
+++ b/sys-power/cpufreqd/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-power/cpufreqd
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufreqd/ChangeLog,v 1.63 2010/07/19 19:18:34 josejx Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufreqd/ChangeLog,v 1.64 2011/10/30 04:58:01 binki Exp $
+
+*cpufreqd-2.4.2-r1 (30 Oct 2011)
+
+ 30 Oct 2011; Nathan Phillip Brink <binki@gentoo.org>
+ +cpufreqd-2.4.2-r1.ebuild, +files/cpufreqd-2.4.2-PATH_MAX.patch:
+ Add patch from bug #318287 by Sven Eden <yamakuzure@gmx.net> fixing glibc
+ abort() for potential buffer overflow on startup when compiled with gcc-4.5
+ and CFLAGS="-O1" and passed the -f flag. OKed by steev_.
19 Jul 2010; Joseph Jezak <josejx@gentoo.org> cpufreqd-2.4.2.ebuild:
Marked ppc stable for bug #323195.
diff --git a/sys-power/cpufreqd/cpufreqd-2.4.2-r1.ebuild b/sys-power/cpufreqd/cpufreqd-2.4.2-r1.ebuild
new file mode 100644
index 000000000000..18dca0520252
--- /dev/null
+++ b/sys-power/cpufreqd/cpufreqd-2.4.2-r1.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufreqd/cpufreqd-2.4.2-r1.ebuild,v 1.1 2011/10/30 04:58:01 binki Exp $
+
+EAPI="2"
+
+inherit eutils
+
+NVCLOCK_VERSION="0.8b"
+
+DESCRIPTION="CPU Frequency Daemon"
+HOMEPAGE="http://www.linux.it/~malattia/wiki/index.php/Cpufreqd"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
+ nvidia? ( http://www.linuxhardware.org/nvclock/nvclock${NVCLOCK_VERSION}.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+
+IUSE="acpi apm lm_sensors nforce2 nvidia pmu"
+RDEPEND=">=sys-power/cpufrequtils-002
+ sys-fs/sysfsutils
+ lm_sensors? ( >sys-apps/lm_sensors-3 )"
+DEPEND="sys-apps/sed
+ ${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-conf.d.patch
+ epatch "${FILESDIR}"/${P}-PATH_MAX.patch #318287
+
+ if use nvidia; then
+ cd "${WORKDIR}"/nvclock${NVCLOCK_VERSION}
+ epatch "${FILESDIR}"/nvclock${NVCLOCK_VERSION}-fpic.patch
+ fi
+}
+
+src_configure() {
+ local config
+
+ if use nvidia; then
+ cd "${WORKDIR}"/nvclock${NVCLOCK_VERSION}
+ econf \
+ --disable-gtk \
+ --disable-qt \
+ --disable-nvcontrol \
+ || die "econf nvclock failed"
+ emake -j1 || die "emake nvclock failed"
+ config="--enable-nvclock=${WORKDIR}/nvclock${NVCLOCK_VERSION}"
+ fi
+
+ cd "${S}"
+ econf \
+ $(use_enable acpi) \
+ $(use_enable apm) \
+ $(use_enable lm_sensors sensors) \
+ $(use_enable nforce2) \
+ $(use_enable pmu) \
+ ${config} \
+ || die "econf failed"
+}
+
+src_compile() {
+ if use nvidia; then
+ cd "${WORKDIR}"/nvclock${NVCLOCK_VERSION}
+ fi
+
+ cd "${S}"
+ emake || die "make failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ rm -rf "${D}"/usr/$(get_libdir)/*.la
+ dodoc AUTHORS ChangeLog NEWS README TODO
+ newinitd "${FILESDIR}"/${PN}-init.d ${PN}
+}
+
+pkg_postinst() {
+ if [ -f "${ROOT}"/etc/conf.d/cpufreqd ] ; then
+ ewarn "An old \"/etc/conf.d/cpufreqd\" file was found. It breaks"
+ ewarn "the new init script! Please remove it."
+ ewarn "# rm /etc/conf.d/cpufreqd"
+ fi
+}
diff --git a/sys-power/cpufreqd/files/cpufreqd-2.4.2-PATH_MAX.patch b/sys-power/cpufreqd/files/cpufreqd-2.4.2-PATH_MAX.patch
new file mode 100644
index 000000000000..c628f43401ea
--- /dev/null
+++ b/sys-power/cpufreqd/files/cpufreqd-2.4.2-PATH_MAX.patch
@@ -0,0 +1,19 @@
+https://bugs.gentoo.org/318287: Fix buffer bound checks causing an
+abort when -f commandline parameter is passed.
+
+--- a/src/cpufreqd.h
++++ b/src/cpufreqd.h
+@@ -54,6 +54,12 @@
+ #define DEFAULT_VERBOSITY 3
+
+ #define MAX_STRING_LEN 255
+-#define MAX_PATH_LEN 512
++
++#ifdef HAVE_LIMITS_H
++#include <limits.h>
++#define MAX_PATH_LEN PATH_MAX
++#else
++#define MAX_PATH_LEN 512
++#endif
+
+ #endif /* __CPUFREQD_H__ */