diff options
-rw-r--r-- | net-misc/vde/ChangeLog | 12 | ||||
-rw-r--r-- | net-misc/vde/Manifest | 8 | ||||
-rw-r--r-- | net-misc/vde/files/vde-2.2.2-gcc43.patch | 60 | ||||
-rw-r--r-- | net-misc/vde/files/vde-2.2.2-slirpvde-buffer-overflow.patch | 49 | ||||
-rw-r--r-- | net-misc/vde/files/vde.conf | 18 | ||||
-rw-r--r-- | net-misc/vde/files/vde.init | 39 | ||||
-rw-r--r-- | net-misc/vde/metadata.xml | 11 | ||||
-rw-r--r-- | net-misc/vde/vde-2.2.2.ebuild | 39 | ||||
-rw-r--r-- | profiles/categories | 5 |
9 files changed, 237 insertions, 4 deletions
diff --git a/net-misc/vde/ChangeLog b/net-misc/vde/ChangeLog new file mode 100644 index 0000000..f878f63 --- /dev/null +++ b/net-misc/vde/ChangeLog @@ -0,0 +1,12 @@ +# ChangeLog for net-misc/vde +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + + 03 Apr 2009; Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> + +net-misc/vde/files/vde-2.2.2-gcc43.patch, + +net-misc/vde/files/vde-2.2.2-slirpvde-buffer-overflow.patch, + +net-misc/vde/files/vde.conf, +net-misc/vde/files/vde.init, + +net-misc/vde/metadata.xml, profiles/categories: + Initial import of vde to apply my initscript changes and test slirpvde + patch. + diff --git a/net-misc/vde/Manifest b/net-misc/vde/Manifest new file mode 100644 index 0000000..65aabca --- /dev/null +++ b/net-misc/vde/Manifest @@ -0,0 +1,8 @@ +AUX vde-2.2.2-gcc43.patch 1867 RMD160 e5587fa07b9c8e8caa3f2f03b2dca7f2858478a2 SHA1 cc22e018d5347cae34f430e2f6075b56c0c797d5 SHA256 313a1c3477241adfaf0547577457de669b369a1e83876e1c494d64e0524a4463 +AUX vde-2.2.2-slirpvde-buffer-overflow.patch 1427 RMD160 3baca367b80d0b80f87135f4527915a1951a6162 SHA1 bcc6000255658e89f209222f56d53731f9d58866 SHA256 4e21492c1ca73bba9adcd1e17f6b51b15912631ce18042bf9d2a0b618c0056d0 +AUX vde.conf 437 RMD160 a4cc478ebb08e1a82cf7bf9038f7ad5fe04d5301 SHA1 535d1293718e04716e93653d78d5e6c8b603591b SHA256 d621091e674f5446b1e85fdccebd59e4da26a3096ab2ceca8cbefbf63c5b7a32 +AUX vde.init 1142 RMD160 25155040d5a3559b392d0dc6bd9a129f9996f2f8 SHA1 aeb48604056c8b87b4c9b837f40155b1d64ea5ca SHA256 b2770472f2089850a1686d1e277200cc9ff4f71a6e2d437d31373c496d8bc07c +DIST vde2-2.2.2.tar.bz2 472059 RMD160 a7b993cc89c824f177790166daa3a7630415b429 SHA1 aca69699cb5f7cd5dec71daaf5d4bc9f05450315 SHA256 7d4b68c1ba1b661db05ff3674abff4d2ad5da31bb3471699bbec3f2f360b483a +EBUILD vde-2.2.2.ebuild 1384 RMD160 626b9c62348c76de8d17d8fcaff60af82d9ed9aa SHA1 ff5d53c948c37febd31936968471fbb895d09774 SHA256 d454e9b884269a51f0db722d82aa5316651c677c789e5ae702de40ad1ce54361 +MISC ChangeLog 485 RMD160 580c56eaa73c881c997905bc30501df59f3caad4 SHA1 77eaee1730ed0a2a593b9f67a439c67e545e13a8 SHA256 ecb878de59db0c9b13c100386abfd30395ba1b866017abb53d5df1024ed3a6f2 +MISC metadata.xml 288 RMD160 c314a4ae7d20127a7f122d8f747f9776fc58c90e SHA1 f9ced3d1077086b104445717d189c45d8910ed35 SHA256 7ae22a10da16a6c94dda42f6a6e810101dc6f46e32865ae92b42bcf9c22eb53b diff --git a/net-misc/vde/files/vde-2.2.2-gcc43.patch b/net-misc/vde/files/vde-2.2.2-gcc43.patch new file mode 100644 index 0000000..3b6e7b0 --- /dev/null +++ b/net-misc/vde/files/vde-2.2.2-gcc43.patch @@ -0,0 +1,60 @@ +diff -NrU5 vde2-2.2.2.orig/src/kvde_switch/consmgmt.c vde2-2.2.2/src/kvde_switch/consmgmt.c +--- vde2-2.2.2.orig/src/kvde_switch/consmgmt.c 2008-09-04 21:14:55.000000000 +0200 ++++ vde2-2.2.2/src/kvde_switch/consmgmt.c 2008-09-04 21:16:26.000000000 +0200 +@@ -22,10 +22,11 @@ + #include <net/if.h> + #include <stdarg.h> + #include <getopt.h> + #include <dlfcn.h> + #include <time.h> ++#include <linux/limits.h> + + #include <config.h> + #include <vde.h> + #include <vdecommon.h> + +diff -NrU5 vde2-2.2.2.orig/src/kvde_switch/datasock.c vde2-2.2.2/src/kvde_switch/datasock.c +--- vde2-2.2.2.orig/src/kvde_switch/datasock.c 2008-09-04 21:14:55.000000000 +0200 ++++ vde2-2.2.2/src/kvde_switch/datasock.c 2008-09-04 21:19:59.000000000 +0200 +@@ -24,10 +24,11 @@ + #include <net/if.h> + #include <stdarg.h> + #include <grp.h> + #define _GNU_SOURCE + #include <getopt.h> ++#include <linux/limits.h> + + #include <config.h> + #include <vde.h> + #include <vdecommon.h> + +diff -NrU5 vde2-2.2.2.orig/src/vde_plug2tap.c vde2-2.2.2/src/vde_plug2tap.c +--- vde2-2.2.2.orig/src/vde_plug2tap.c 2008-09-04 21:14:55.000000000 +0200 ++++ vde2-2.2.2/src/vde_plug2tap.c 2008-09-04 21:22:23.000000000 +0200 +@@ -16,10 +16,11 @@ + #include <stdarg.h> + #include <syslog.h> + #include <libgen.h> + #define _GNU_SOURCE + #include <getopt.h> ++#include <linux/limits.h> + + #include <config.h> + #include <vde.h> + #include <vdecommon.h> + #include <libvdeplug.h> +diff -NrU5 vde2-2.2.2.orig/src/wirefilter.c vde2-2.2.2/src/wirefilter.c +--- vde2-2.2.2.orig/src/wirefilter.c 2008-09-04 21:14:55.000000000 +0200 ++++ vde2-2.2.2/src/wirefilter.c 2008-09-04 21:25:21.000000000 +0200 +@@ -29,10 +29,11 @@ + #include <sys/time.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/socket.h> + #include <sys/un.h> ++#include <linux/limits.h> + + #include <config.h> + #include <vde.h> + #include <vdecommon.h> + #include <libvdeplug.h> diff --git a/net-misc/vde/files/vde-2.2.2-slirpvde-buffer-overflow.patch b/net-misc/vde/files/vde-2.2.2-slirpvde-buffer-overflow.patch new file mode 100644 index 0000000..cc494e1 --- /dev/null +++ b/net-misc/vde/files/vde-2.2.2-slirpvde-buffer-overflow.patch @@ -0,0 +1,49 @@ +From d466d77be6ec40d8d7d96050fbee5e17e7c61af9 Mon Sep 17 00:00:00 2001 +From: Ludwig Nussel <ludwig.nussel@suse.de> +Date: Tue, 30 Sep 2008 16:59:01 +0200 +Subject: [PATCH] fix static buffer overflows + +--- + src/slirpvde/slirpvde.c | 12 +++++++----- + 1 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/src/slirpvde/slirpvde.c b/src/slirpvde/slirpvde.c +index 47512ca..016aa45 100644 +--- a/src/slirpvde/slirpvde.c ++++ b/src/slirpvde/slirpvde.c +@@ -53,7 +53,7 @@ + VDECONN *conn; + int dhcpmgmt=0; + static char *pidfile = NULL; +-static char pidfile_path[_POSIX_PATH_MAX]; ++static char pidfile_path[PATH_MAX]; + int logok=0; + char *prog; + extern FILE *lfd; +@@ -78,9 +78,11 @@ void printlog(int priority, const char *format, ...) + static void save_pidfile() + { + if(pidfile[0] != '/') +- strncat(pidfile_path, pidfile, PATH_MAX - strlen(pidfile_path)); +- else +- strcpy(pidfile_path, pidfile); ++ strncat(pidfile_path, pidfile, sizeof(pidfile_path) - strlen(pidfile_path) -1); ++ else { ++ pidfile_path[0] = 0; ++ strncat(pidfile_path, pidfile, sizeof(pidfile_path)-1); ++ } + + int fd = open(pidfile_path, + O_WRONLY | O_CREAT | O_EXCL, +@@ -433,7 +435,7 @@ int main(int argc, char **argv) + exit(1); + } + +- strcat(pidfile_path, "/"); ++ strncat(pidfile_path, "/", sizeof(pidfile_path) - strlen(pidfile_path) -1); + if (daemonize && daemon(0, 0)) { + printlog(LOG_ERR,"daemon: %s",strerror(errno)); + exit(1); +-- +1.5.6 + diff --git a/net-misc/vde/files/vde.conf b/net-misc/vde/files/vde.conf new file mode 100644 index 0000000..f724065 --- /dev/null +++ b/net-misc/vde/files/vde.conf @@ -0,0 +1,18 @@ +# load the tun module +#vde_modprobe_tun="yes" + +# virtual tap networking device to be used for each vde switch +vde0_tap="vtap0" +#vde1_tap="vtap1" + +# mode and group for the socket +vde_sock_chmod="770" +vde_sock_chown=":kvm" + +# virtual socket to be used for each vde switch +vde0_sock_path="/var/run/ctl.vde0" +#vde1_sock_path="/var/run/ctl.vde1" + +# mgmt port for each vde switch +vde0_mgmt="/var/run/mgmt.vde0" +#vde1_mgmt="/var/run/mgmt.vde1" diff --git a/net-misc/vde/files/vde.init b/net-misc/vde/files/vde.init new file mode 100644 index 0000000..11b388a --- /dev/null +++ b/net-misc/vde/files/vde.init @@ -0,0 +1,39 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/vde/files/vde.init,v 1.3 2008/03/11 21:34:49 genstef Exp $ + +depend() { + local ifvar=${RC_SVCNAME#*.} + eval iftap=\$${ifvar}_tap + + after "net.${iftap}" +} + +start() { + local ifvar=${RC_SVCNAME#*.} + + eval ifsockpath=\$${ifvar}_sock_path + eval ifmgmt=\$${ifvar}_mgmt + eval iftap=\$${ifvar}_tap + + ebegin "Starting ${ifvar}" + [ "${vde_modprobe_tun}" == "yes" ] && modprobe tun + start-stop-daemon --start --quiet \ + --exec /usr/bin/vde_switch -- -tap ${iftap} -daemon -s ${ifsockpath} -M ${ifmgmt} + eend $? "Failed to start ${ifvar}" + chmod -R ${vde_sock_chmod} ${ifsockpath} + chown -R ${vde_sock_chown} ${ifsockpath} +} + +stop() { + local ifvar=${RC_SVCNAME#*.} + eval ifsockpath=\$${ifvar}_SOCK_PATH + eval iftap=\$${ifvar}_TAP + + ebegin "Stopping ${ifvar}" + [ "${vde_modprobe_tun}" == "yes" ] && modprobe -r tun + start-stop-daemon --stop --quiet \ + --exec "/usr/bin/vde_switch -s ${ifsockpath}" -- -tap ${iftap} -daemon + eend $? "Failed to stop ${ifvar}" +} diff --git a/net-misc/vde/metadata.xml b/net-misc/vde/metadata.xml new file mode 100644 index 0000000..9576fb3 --- /dev/null +++ b/net-misc/vde/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>no-herd</herd> +<maintainer> + <email>dang@gentoo.org</email> +</maintainer> +<maintainer> + <email>mlspamcb@noci.xs4all.nl</email> +</maintainer> +</pkgmetadata> diff --git a/net-misc/vde/vde-2.2.2.ebuild b/net-misc/vde/vde-2.2.2.ebuild new file mode 100644 index 0000000..09a99cc --- /dev/null +++ b/net-misc/vde/vde-2.2.2.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/vde/vde-2.2.2.ebuild,v 1.4 2009/03/06 22:36:38 lu_zero Exp $ + +inherit base eutils + +MY_P="${PN}2-${PV}" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="vde2 is a virtual distributed ethernet emulator for emulators like qemu, bochs, and uml." +SRC_URI="mirror://sourceforge/vde/${MY_P}.tar.bz2" +HOMEPAGE="http://vde.sourceforge.net/" +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="amd64 ~ppc ~ppc64 x86" +IUSE="" +DEPEND="" + +# The slirpvde-buffer-overflow patch was made by Ludwig Nussel and submitted upstream at +# http://sourceforge.net/tracker/?func=detail&aid=2138410&group_id=95403&atid=611248 +PATCHES=( "${FILESDIR}/${P}-gcc43.patch" "${FILESDIR}/${P}-slirpvde-buffer-overflow.patch" ) + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + newinitd "${FILESDIR}"/vde.init vde + newconfd "${FILESDIR}"/vde.conf vde + + dodoc INSTALL README +} + +pkg_postinst() { + # default group already used in kqemu + enewgroup qemu + einfo "To start vde automatically add it to the default runlevel:" + einfo "# rc-update add vde default" + einfo "You need to setup tap0 in /etc/conf.d/net" + einfo "To use it as an user be sure to set a group in /etc/conf.d/vde" + einfo "Users of the group can then run: $ vdeq qemu -sock /var/run/vde.ctl ..other opts" +} diff --git a/profiles/categories b/profiles/categories index 9750f30..fb49958 100644 --- a/profiles/categories +++ b/profiles/categories @@ -1,4 +1 @@ -app-office -dev-libs -kde-base -media-sound +net-misc |