summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-10-11 20:41:05 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-10-11 20:41:05 +0000
commitb0f1be7da385ea73623ee13dcf95e58cfa162c91 (patch)
tree3abe97d589ecf4249ec7ace5ddf39f1928942665 /net-misc
parentFix buffer overflow wrt bug 339901. Thanks to Diego for the report. Respect C... (diff)
downloadgentoo-2-b0f1be7da385ea73623ee13dcf95e58cfa162c91.tar.gz
gentoo-2-b0f1be7da385ea73623ee13dcf95e58cfa162c91.tar.bz2
gentoo-2-b0f1be7da385ea73623ee13dcf95e58cfa162c91.zip
Revision bump: fix overflow on 64-bit systems; update init script to note use --quiet and stop correctly; respect LDFLAGS (bug #334815); add debug USE flag.
(Portage version: 2.2_rc91/cvs/Linux x86_64)
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/gateway6/ChangeLog13
-rw-r--r--net-misc/gateway6/files/gateway6-6.0-overflow.patch26
-rw-r--r--net-misc/gateway6/files/gw6c.rc236
-rw-r--r--net-misc/gateway6/gateway6-6.0-r1.ebuild80
-rw-r--r--net-misc/gateway6/gateway6-6.0-r2.ebuild77
-rw-r--r--net-misc/gateway6/metadata.xml24
6 files changed, 165 insertions, 91 deletions
diff --git a/net-misc/gateway6/ChangeLog b/net-misc/gateway6/ChangeLog
index 1fb7559d7c91..0dac5b7eb440 100644
--- a/net-misc/gateway6/ChangeLog
+++ b/net-misc/gateway6/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for net-misc/gateway6
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/gateway6/ChangeLog,v 1.2 2009/06/04 07:40:34 voyageur Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/gateway6/ChangeLog,v 1.3 2010/10/11 20:41:05 flameeyes Exp $
+
+*gateway6-6.0-r2 (11 Oct 2010)
+
+ 11 Oct 2010; Diego E. Pettenò <flameeyes@gentoo.org>
+ +gateway6-6.0-r2.ebuild, +files/gateway6-6.0-overflow.patch,
+ +files/gw6c.rc2, -gateway6-6.0-r1.ebuild, metadata.xml:
+ Revision bump: fix overflow on 64-bit systems; update init script to note
+ use --quiet and stop correctly; respect LDFLAGS (bug #334815); add debug
+ USE flag.
*gateway6-6.0-r1 (04 Jun 2009)
diff --git a/net-misc/gateway6/files/gateway6-6.0-overflow.patch b/net-misc/gateway6/files/gateway6-6.0-overflow.patch
new file mode 100644
index 000000000000..5fa99f6995ad
--- /dev/null
+++ b/net-misc/gateway6/files/gateway6-6.0-overflow.patch
@@ -0,0 +1,26 @@
+Index: gw6c-6_0-RELEASE/gw6c-config/src/gw6cvalidation.cc
+===================================================================
+--- gw6c-6_0-RELEASE.orig/gw6c-config/src/gw6cvalidation.cc
++++ gw6c-6_0-RELEASE/gw6c-config/src/gw6cvalidation.cc
+@@ -516,7 +516,7 @@ bool Validate_ClientV4( const string& sC
+ if( sClientV4 != STR_AUTO )
+ {
+ struct in_addr address;
+- unsigned long net;
++ in_addr_t net;
+
+ net = inet_addr( sClientV4.c_str() );
+ memcpy(&address, &net, sizeof(net));
+Index: gw6c-6_0-RELEASE/gw6c-config/src/hap6devicemappingconfig.cc
+===================================================================
+--- gw6c-6_0-RELEASE.orig/gw6c-config/src/hap6devicemappingconfig.cc
++++ gw6c-6_0-RELEASE/gw6c-config/src/hap6devicemappingconfig.cc
+@@ -269,7 +269,7 @@ bool HAP6DeviceMappingConfig::ValidateIP
+ // Check if IPv4 or IPv6 address
+ struct in6_addr addressv6;
+ struct in_addr addressv4;
+- unsigned long net;
++ in_addr_t net;
+
+ net = inet_addr( aIPAddress.c_str() );
+ memcpy(&addressv4, &net, sizeof(net));
diff --git a/net-misc/gateway6/files/gw6c.rc2 b/net-misc/gateway6/files/gw6c.rc2
new file mode 100644
index 000000000000..58b7c67d66b4
--- /dev/null
+++ b/net-misc/gateway6/files/gw6c.rc2
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/gateway6/files/gw6c.rc2,v 1.1 2010/10/11 20:41:05 flameeyes Exp $
+
+GATEWAY6_CLIENT="/usr/sbin/gw6c"
+
+depend() {
+ need net localmount
+ after bootmisc
+ use dns logger
+}
+
+checkconfig() {
+ [ $(uname -s) = "Linux" ] || return 0
+ [ -e /dev/net/tun ] && return 0
+ modprobe tun && return 0
+
+ eerror "TUN/TAP support is not available in the running kernel"
+ return 1
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting Gateway6 IPv6 Client"
+ start-stop-daemon --start --exec $GATEWAY6_CLIENT \
+ --chdir /var/lib/gateway6 -- -f /etc/gateway6/gw6c.conf
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Gateway6 IPv6 Client"
+ start-stop-daemon --stop --exec $GATEWAY6_CLIENT
+ eend $?
+}
diff --git a/net-misc/gateway6/gateway6-6.0-r1.ebuild b/net-misc/gateway6/gateway6-6.0-r1.ebuild
deleted file mode 100644
index 98ec2bf1a977..000000000000
--- a/net-misc/gateway6/gateway6-6.0-r1.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/gateway6/gateway6-6.0-r1.ebuild,v 1.1 2009/06/04 07:40:34 voyageur Exp $
-
-inherit eutils versionator toolchain-funcs
-
-MY_P=gw6c-$(replace_all_version_separators "_")
-MY_P=${MY_P/_beta/-BETA}
-
-DESCRIPTION="Client to connect to a tunnel broker using the TSP protocol (freenet6 for example)"
-HOMEPAGE="http://go6.net/4105/application.asp"
-SRC_URI="http://go6.net/4105/file.asp?file_id=158&file=/${MY_P}.tar.gz"
-
-LICENSE="VPL-1.0"
-SLOT="0"
-KEYWORDS="~amd64 ~hppa ~sparc ~x86"
-IUSE="radvd"
-
-DEPEND="dev-libs/openssl
- sys-apps/iproute2
- radvd? ( net-misc/radvd )"
-RDEPEND="${DEPEND}"
-
-S="${WORKDIR}/${MY_P}-RELEASE"
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
-
- epatch "${FILESDIR}"/${PN}-6.0_beta4-no-template-validation.patch
-
- for i in gw6c-config gw6c-messaging ; do
- sed -i -e "s/-O2//" \
- -e "s/CXXFLAGS=/CXXFLAGS+=/" \
- -e "s/CFLAGS=/CFLAGS+=/" \
- -e "s/LDFAGS=/LDFLAGS+=/" \
- ${i}/Makefile || die "sed failed in ${i}"
- done
-
- cd tspc-advanced
- for i in platform/linux platform/unix-common src/lib src/net src/tsp src/xml ; do
- sed -i -e "s/-O2//" \
- -e "s/CXXFLAGS=/CXXFLAGS+=/" \
- -e "s/CFLAGS=/CFLAGS+=/" \
- -e "s/LDFAGS=/LDFLAGS+=/" \
- ${i}/Makefile || die "sed failed in ${i}"
- done
-}
-
-src_compile() {
- # Parallel compilation broken
- emake -j1\
- AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" \
- CC="$(tc-getCC)" CXX="$(tc-getCXX)" \
- all configdir=/etc/gateway6 target=linux || die "Build Failed"
-}
-
-src_install() {
- cd "${S}"/tspc-advanced
- dosbin bin/gw6c
-
- insopts -m 600
- insinto /etc/gateway6
- doins "${FILESDIR}"/gw6c.conf
- exeinto /etc/gateway6/template
- doexe template/linux.sh
-
- newinitd "${FILESDIR}"/gw6c.rc gw6c
-
- doman man/{man5/gw6c.conf.5,man8/gw6c.8}
- dodir /var/lib/gateway6
-
- dodoc "${S}"/*.pdf
-}
-
-pkg_postinst() {
- elog "To add support for a TSP IPv6 connection at startup,"
- elog "remember to run:"
- elog "# rc-update add gw6c default"
-}
diff --git a/net-misc/gateway6/gateway6-6.0-r2.ebuild b/net-misc/gateway6/gateway6-6.0-r2.ebuild
new file mode 100644
index 000000000000..ead4b0873870
--- /dev/null
+++ b/net-misc/gateway6/gateway6-6.0-r2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/gateway6/gateway6-6.0-r2.ebuild,v 1.1 2010/10/11 20:41:05 flameeyes Exp $
+
+EAPI=2
+
+inherit eutils versionator toolchain-funcs
+
+MY_P=gw6c-$(replace_all_version_separators "_")
+MY_P=${MY_P/_beta/-BETA}
+
+DESCRIPTION="Client to connect to a tunnel broker using the TSP protocol (freenet6 for example)"
+HOMEPAGE="http://go6.net/4105/application.asp"
+SRC_URI="http://go6.net/4105/file.asp?file_id=158&file=/${MY_P}.tar.gz"
+
+LICENSE="VPL-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~sparc ~x86"
+IUSE="debug"
+
+DEPEND="dev-libs/openssl"
+RDEPEND="${DEPEND}
+ sys-apps/iproute2"
+
+S="${WORKDIR}/${MY_P}-RELEASE"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-6.0_beta4-no-template-validation.patch
+ epatch "${FILESDIR}"/${P}-overflow.patch
+
+ # Make the makefile handle linking correctly
+ find . -name Makefile -exec sed -i \
+ -e 's:LDFLAGS:LDLIBS:g' \
+ -e '/\$(LDLIBS)/s:-o:$(LDFLAGS) -o:' \
+ {} + || die "multised failed"
+}
+
+src_configure() { :; }
+
+src_compile() {
+ # parallel make fails as inter-directory dependecies are missing.
+ emake -j1 \
+ AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" \
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getCXX)" \
+ EXTRA_CFLAGS="${CFLAGS}" EXTRA_CXXFLAGS="${CXXFLAGS}" \
+ $(use debug && echo DEBUG=1) \
+ all configdir=/etc/gateway6 target=linux || die "Build Failed"
+}
+
+src_install() {
+ cd "${S}"/tspc-advanced
+ dosbin bin/gw6c || die
+
+ insopts -m 600
+ insinto /etc/gateway6
+ doins "${FILESDIR}"/gw6c.conf || die
+ exeinto /etc/gateway6/template
+ doexe template/linux.sh || die
+
+ newinitd "${FILESDIR}"/gw6c.rc2 gw6c || die
+
+ doman man/{man5/gw6c.conf.5,man8/gw6c.8} || die
+ keepdir /var/lib/gateway6 || die
+
+ insinto /usr/share/doc/${PF}
+ doins "${S}"/*.pdf || die
+}
+
+pkg_postinst() {
+ elog "To add support for a TSP IPv6 connection at startup,"
+ elog "remember to run:"
+ elog "# rc-update add gw6c default"
+ elog ""
+ elog "NOTE: authenticated connection to broker.freenet6.net seems to"
+ elog "not work with gateway6 anymore, it only seems to work with"
+ elog "anonymous usage."
+}
diff --git a/net-misc/gateway6/metadata.xml b/net-misc/gateway6/metadata.xml
index 4408f7d69a98..d6e3153b7f5c 100644
--- a/net-misc/gateway6/metadata.xml
+++ b/net-misc/gateway6/metadata.xml
@@ -1,13 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <herd>no-herd</herd>
- <maintainer>
- <email>voyageur@gentoo.org</email>
- <name>Bernard Cafarelli</name>
- </maintainer>
- <longdescription>TSP is a control protocol used to establish and maintain static tunnels. The Gateway6 client is used on the host computer to connect to a tunnel broker using the TSP protocol and to get the information for its tunnel. When it receives the information for the tunnel, the Gateway6 client creates the static tunnel on its operating system</longdescription>
- <use>
- <flag name="radvd">Enable support for <pkg>net-misc/radvd</pkg></flag>
- </use>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>voyageur@gentoo.org</email>
+ <name>Bernard Cafarelli</name>
+ </maintainer>
+ <maintainer>
+ <email>flameeyes@gentoo.org</email>
+ <name>Diego Elio Pettenò</name>
+ </maintainer>
+ <longdescription>
+ TSP is a control protocol used to establish and maintain static tunnels. The Gateway6 client is
+ used on the host computer to connect to a tunnel broker using the TSP protocol and to get the
+ information for its tunnel. When it receives the information for the tunnel, the Gateway6 client
+ creates the static tunnel on its operating system
+</longdescription>
</pkgmetadata>