diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-01-29 18:57:17 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-01-29 18:57:17 +0000 |
commit | a6c899c3e9283c3f6665629bbc4f5af1ffbf5ab7 (patch) | |
tree | 6918ddf5418c02a7d41144d7a8ce44f915ca9782 /sys-apps/pciutils | |
parent | keyword ~x86-fbsd (diff) | |
download | gentoo-2-a6c899c3e9283c3f6665629bbc4f5af1ffbf5ab7.tar.gz gentoo-2-a6c899c3e9283c3f6665629bbc4f5af1ffbf5ab7.tar.bz2 gentoo-2-a6c899c3e9283c3f6665629bbc4f5af1ffbf5ab7.zip |
Add fix by Andreas Wiese for NULL ptr deref #256464.
(Portage version: 2.2_rc23/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/pciutils')
-rw-r--r-- | sys-apps/pciutils/ChangeLog | 8 | ||||
-rw-r--r-- | sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch | 24 | ||||
-rw-r--r-- | sys-apps/pciutils/pciutils-3.1.0-r1.ebuild | 70 |
3 files changed, 101 insertions, 1 deletions
diff --git a/sys-apps/pciutils/ChangeLog b/sys-apps/pciutils/ChangeLog index d90598d6b5cc..b8e70470838e 100644 --- a/sys-apps/pciutils/ChangeLog +++ b/sys-apps/pciutils/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-apps/pciutils # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/ChangeLog,v 1.157 2009/01/29 18:25:59 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/ChangeLog,v 1.158 2009/01/29 18:57:16 vapier Exp $ + +*pciutils-3.1.0-r1 (29 Jan 2009) + + 29 Jan 2009; Mike Frysinger <vapier@gentoo.org> + +files/pciutils-3.1.0-null-ptr.patch, +pciutils-3.1.0-r1.ebuild: + Add fix by Andreas Wiese for NULL ptr deref #256464. 29 Jan 2009; Mike Frysinger <vapier@gentoo.org> pciutils-3.1.0.ebuild: Force LC_ALL=C with tr since upper/lower don't work #256447 by Gürkan diff --git a/sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch b/sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch new file mode 100644 index 000000000000..f7aee8a63afb --- /dev/null +++ b/sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch @@ -0,0 +1,24 @@ +http://bugs.gentoo.org/256464 + +if "f" is NULL, dont try to deref it + +patch by Andreas Wiese + +--- a/setpci.c ++++ b/setpci.c +@@ -630,13 +630,13 @@ + e = strchr(value, ','); + if (e) + *e++ = 0; +- if (parse_x32(value, &f, &ll) < 0 || *f && *f != ':') ++ if (parse_x32(value, &f, &ll) < 0 || f && *f != ':') + parse_err("Invalid value \"%s\"", value); + lim = max_values[op->width]; + if (ll > lim && ll < ~0UL - lim) + parse_err("Value \"%s\" is out of range", value); + op->values[j].value = ll; +- if (*f == ':') ++ if (f && *f == ':') + { + if (parse_x32(f+1, NULL, &ll) <= 0) + parse_err("Invalid mask \"%s\"", f+1); diff --git a/sys-apps/pciutils/pciutils-3.1.0-r1.ebuild b/sys-apps/pciutils/pciutils-3.1.0-r1.ebuild new file mode 100644 index 000000000000..2c3daeb8cda4 --- /dev/null +++ b/sys-apps/pciutils/pciutils-3.1.0-r1.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/pciutils-3.1.0-r1.ebuild,v 1.1 2009/01/29 18:57:16 vapier Exp $ + +inherit eutils multilib + +DESCRIPTION="Various utilities dealing with the PCI bus" +HOMEPAGE="http://atrey.karlin.mff.cuni.cz/~mj/pciutils.html" +SRC_URI="ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="network-cron zlib" + +DEPEND="zlib? ( sys-libs/zlib )" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${PN}-3.0.0-build.patch #233314 + epatch "${FILESDIR}"/pcimodules-${PN}-3.1.0.patch + epatch "${FILESDIR}"/${P}-null-ptr.patch #256464 + epatch "${FILESDIR}"/${PN}-2.2.7-update-pciids-both-forms.patch + cp "${FILESDIR}"/pcimodules.c . || die + sed -i -e 's:| tr:| LC_ALL=C tr:' lib/configure + sed -i -e "/^LIBDIR=/s:/lib:/$(get_libdir):" Makefile +} + +uyesno() { use $1 && echo yes || echo no ; } +pemake() { + emake \ + HOST="${CHOST}" \ + CROSS_COMPILE="${CHOST}-" \ + DNS="yes" \ + IDSDIR="/usr/share/misc" \ + MANDIR="/usr/share/man" \ + PREFIX="/usr" \ + SHARED="yes" \ + STRIP="" \ + ZLIB=$(uyesno zlib) \ + "$@" +} + +src_compile() { + pemake OPT="${CFLAGS}" all pcimodules || die "emake failed" +} + +src_install() { + pemake DESTDIR="${D}" install install-lib || die + dosbin pcimodules || die + doman "${FILESDIR}"/pcimodules.8 + dodoc ChangeLog README TODO + + if use network-cron ; then + exeinto /etc/cron.monthly + newexe "${FILESDIR}"/pciutils.cron update-pciids \ + || die "Failed to install update cronjob" + fi + + # Install both forms until HAL has migrated + if use zlib ; then + local sharedir="${D}/usr/share/misc" + elog "Providing a backwards compatibility non-compressed pci.ids" + gzip -d <"${sharedir}"/pci.ids.gz >"${sharedir}"/pci.ids + fi + + newinitd "${FILESDIR}"/init.d-pciparm pciparm + newconfd "${FILESDIR}"/conf.d-pciparm pciparm +} |