summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2010-05-09 17:16:15 +0000
committerPeter Volkov <pva@gentoo.org>2010-05-09 17:16:15 +0000
commit60a63000095f1aa85c012a0ff63b62bed0e9a49a (patch)
treeb82fe187907e70c83a1109ac6f1fdd86567c8fc1 /net-firewall/ebtables
parentalpha/sparc stable wrt #312843 (diff)
downloadhistorical-60a63000095f1aa85c012a0ff63b62bed0e9a49a.tar.gz
historical-60a63000095f1aa85c012a0ff63b62bed0e9a49a.tar.bz2
historical-60a63000095f1aa85c012a0ff63b62bed0e9a49a.zip
Fix ebtables tables detection, bug #314529, thank Veovis for report and suggested fix.
Package-Manager: portage-2.1.8.3/cvs/Linux x86_64
Diffstat (limited to 'net-firewall/ebtables')
-rw-r--r--net-firewall/ebtables/ChangeLog9
-rw-r--r--net-firewall/ebtables/Manifest5
-rw-r--r--net-firewall/ebtables/ebtables-2.0.9.2-r1.ebuild65
-rw-r--r--net-firewall/ebtables/files/ebtables.confd-r111
-rw-r--r--net-firewall/ebtables/files/ebtables.initd-r1101
5 files changed, 189 insertions, 2 deletions
diff --git a/net-firewall/ebtables/ChangeLog b/net-firewall/ebtables/ChangeLog
index 14437518a51c..d0b041e6711c 100644
--- a/net-firewall/ebtables/ChangeLog
+++ b/net-firewall/ebtables/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-firewall/ebtables
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/ebtables/ChangeLog,v 1.35 2010/03/16 07:49:08 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/ebtables/ChangeLog,v 1.36 2010/05/09 17:16:15 pva Exp $
+
+*ebtables-2.0.9.2-r1 (09 May 2010)
+
+ 09 May 2010; Peter Volkov <pva@gentoo.org> +ebtables-2.0.9.2-r1.ebuild,
+ +files/ebtables.confd-r1, +files/ebtables.initd-r1:
+ Fix ebtables tables detection, bug #314529, thank Veovis for report and
+ suggested fix.
*ebtables-2.0.9.2 (16 Mar 2010)
diff --git a/net-firewall/ebtables/Manifest b/net-firewall/ebtables/Manifest
index e1413fb817bf..9ac15899f40b 100644
--- a/net-firewall/ebtables/Manifest
+++ b/net-firewall/ebtables/Manifest
@@ -4,11 +4,14 @@ AUX ebtables-v2.0.8-2-ethertype-DESTDIR-mkdir.patch 1619 RMD160 62f324507577cdcb
AUX ebtables-v2.0.9-1-LDFLAGS.diff 1874 RMD160 e7c0fc175b1d44fbc4c91f50377b8e3fb74e54f2 SHA1 e8cddfd6ee81b13f0ccb3d3cb7cfc003eee0bd29 SHA256 988bf04df31a3696e12d8c8d856610291038c383956857ee3b239108213e8212
AUX ebtables-v2.0.9-2-LDFLAGS.diff 1877 RMD160 fbe4771271a4b95cab0867a89e4dd7444ca2eeb8 SHA1 9500c735a7184c728f68602a438f833ba2916277 SHA256 083c2da165854376a49122f33dd5cd4e2dba1bb4c4a29141f6675d8a42b23dae
AUX ebtables.confd 466 RMD160 84f7bea9b78ae9fab08cc446c1cd64e74fe4e4f9 SHA1 2bf5e4db2fde07a9791c43cb27575aefe30cc895 SHA256 fa8dedd95f1a6834022e409754e1e41219a7671a1bbb99b2094356239135730d
+AUX ebtables.confd-r1 288 RMD160 97d8fd8a00b48d70881aff05c1fa533e1da7172b SHA1 89b16bf882290bfc31c890948245552da5b26b4d SHA256 c05a6c1ba6add3881068584074681b04bfb2ad43284d7bdd67f47f3da842de58
AUX ebtables.initd 2078 RMD160 da8ca12a06bf4134436b8c858b022935b95f7ab4 SHA1 d8d3628cbdc251d22558fc5761be95d012586f7f SHA256 14d443045dc1f9a3da84a4dc07040ac8a6d6042a2d87305b9eeca8495703cb53
+AUX ebtables.initd-r1 2071 RMD160 bbc77bbb64a2f73c97647d45e7707ee74da8573e SHA1 72e6b79826d47f7312947e5f2366e9130f690607 SHA256 cef208f784b24abcc7af313355d103ee1c78ade42fb1cee3936b209c012d7a80
DIST ebtables-v2.0.9-1.tar.gz 101781 RMD160 9ec134cbb21be5eb085ad7f405c26363d29d38f9 SHA1 b0b011edb5872f266b9bbb127fe292d1e745dbc3 SHA256 8aefbc4480b1f6b6766fdb26779cd9eb9609278ad294b7585e533270e039bdc6
DIST ebtables-v2.0.9-2.tar.gz 101529 RMD160 7dff076ab14dbc2c9e64813c745f1513498fdaa8 SHA1 93b684cf788592f976a12a5f71c3aa9d185a309c SHA256 98855f644d43c615a8e663197978e49c95642f46f2bbf8e6f3213af87f8ad6a3
EBUILD ebtables-2.0.9.1-r1.ebuild 2000 RMD160 3e150a35ffe727f6695e59a96be13165987da19a SHA1 391427ed49a6bbd9090196629ef93b0108fc5185 SHA256 9da82fcced6e9b3ad769fe7c321775ec26c1806d8b6882a24879071f2ff91f11
EBUILD ebtables-2.0.9.1.ebuild 1703 RMD160 7bd7b57d7b2117cbf5f44a0f5aea57f1db713ca0 SHA1 3e16ccc4dff504aa8e8683989ee5fb7d238ec878 SHA256 25807c88a348854d3b58ba1e0e99ae2ace4f6d4b85ea05f1573864aea2b9ae52
+EBUILD ebtables-2.0.9.2-r1.ebuild 1959 RMD160 79c1baf04c708b6b34e4f40f00b7cfadb3b99ccc SHA1 73171db6859109caca427a525773f69ea3ca536f SHA256 46f614e7cc7654a969108f341d7b7c0307997b047613f4ceae909092ff16b651
EBUILD ebtables-2.0.9.2.ebuild 1950 RMD160 00ab06c4531c3aa875bbc9b555a98d62c06f506e SHA1 584b4631e5db26720212bf001fdef976d266978a SHA256 8ebb637de0fe50c4b9b131d2b04ee27e2981497e3fd00fe9ce99c2805719e294
-MISC ChangeLog 5888 RMD160 26ac00ed84f14867eb095a07117338623d3e4145 SHA1 4fd61122f62787ddf8d03d725126ba969dfe1467 SHA256 851e7fb5ed2b05b8fa99fea9ef93c4b5b21fb0aa293d3728ccea970b5d059746
+MISC ChangeLog 6144 RMD160 142eb633209a1a4d437334cefb0256b525961469 SHA1 69b3ec007beeb6edc0a701850914e8f57e41c5c7 SHA256 3727f713668b5ac5f51803ec35672f3f292f4a8d76e26c36acb142bfe73ae4dd
MISC metadata.xml 251 RMD160 2acabb95dba06572ab5dfd2a6d7bca5ab53d7a64 SHA1 6bf96c40f48fb4f92026dd80b7b3e1ce7ebdc9d1 SHA256 8d646b2f01acd31f9bc065850081adfa7f1dfabd8e305e05331fc6d21cbbd504
diff --git a/net-firewall/ebtables/ebtables-2.0.9.2-r1.ebuild b/net-firewall/ebtables/ebtables-2.0.9.2-r1.ebuild
new file mode 100644
index 000000000000..72fc2ca41598
--- /dev/null
+++ b/net-firewall/ebtables/ebtables-2.0.9.2-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/ebtables/ebtables-2.0.9.2-r1.ebuild,v 1.1 2010/05/09 17:16:15 pva Exp $
+
+EAPI="2"
+
+inherit versionator eutils toolchain-funcs multilib flag-o-matic
+
+MY_PV=$(replace_version_separator 3 '-' )
+MY_P=${PN}-v${MY_PV}
+
+DESCRIPTION="Utility that enables basic Ethernet frame filtering on a Linux bridge, MAC NAT and brouting."
+HOMEPAGE="http://ebtables.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="static"
+LICENSE="GPL-2"
+SLOT="0"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ if use static; then
+ ewarn "You've chosen static build which is useful for embedded devices."
+ ewarn "It has no init script. Make sure that's really what you want."
+ fi
+}
+
+src_prepare() {
+ # Enhance ebtables-save to take table names as parameters bug #189315
+ epatch "${FILESDIR}/${PN}-2.0.8.1-ebt-save.diff"
+ epatch "${FILESDIR}/${PN}-v2.0.9-2-LDFLAGS.diff"
+ epatch "${FILESDIR}/${PN}-v2.0.8-2-ethertype-DESTDIR-mkdir.patch"
+
+ sed -i -e "s,^MANDIR:=.*,MANDIR:=/usr/share/man," \
+ -e "s,^BINDIR:=.*,BINDIR:=/sbin," \
+ -e "s,^INITDIR:=.*,INITDIR:=/usr/share/doc/${PF}," \
+ -e "s,^SYSCONFIGDIR:=.*,SYSCONFIGDIR:=/usr/share/doc/${PF}," \
+ -e "s,^LIBDIR:=.*,LIBDIR:=/$(get_libdir)/\$(PROGNAME)," Makefile
+}
+
+src_compile() {
+ # This package uses _init functions to initialise extensions. With
+ # --as-needed this will not work.
+ append-ldflags $(no-as-needed)
+ emake \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ $(use static && echo static) \
+ || die "emake failed"
+}
+
+src_install() {
+ if ! use static; then
+ make DESTDIR="${D}" install || die
+ keepdir /var/lib/ebtables/
+ newinitd "${FILESDIR}"/ebtables.initd-r1 ebtables || die
+ newconfd "${FILESDIR}"/ebtables.confd-r1 ebtables || die
+ else
+ into /
+ newsbin static ebtables || die
+ fi
+ dodoc ChangeLog THANKS || die
+}
diff --git a/net-firewall/ebtables/files/ebtables.confd-r1 b/net-firewall/ebtables/files/ebtables.confd-r1
new file mode 100644
index 000000000000..645b26edae99
--- /dev/null
+++ b/net-firewall/ebtables/files/ebtables.confd-r1
@@ -0,0 +1,11 @@
+# /etc/conf.d/ebtables
+
+# Location in which ebtables initscript will save set rules on
+# service shutdown
+EBTABLES_SAVE="/var/lib/ebtables/rules-save"
+
+# Options to pass to ebtables-save and ebtables-restore
+SAVE_RESTORE_OPTIONS=""
+
+# Save state on stopping ebtables
+SAVE_ON_STOP="yes"
diff --git a/net-firewall/ebtables/files/ebtables.initd-r1 b/net-firewall/ebtables/files/ebtables.initd-r1
new file mode 100644
index 000000000000..1088ad3f5c49
--- /dev/null
+++ b/net-firewall/ebtables/files/ebtables.initd-r1
@@ -0,0 +1,101 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/ebtables/files/ebtables.initd-r1,v 1.1 2010/05/09 17:16:15 pva Exp $
+
+opts="save reload panic"
+
+ebtables_bin="/sbin/ebtables"
+ebtables_save=${EBTABLES_SAVE}
+
+depend() {
+ before net
+ use logger
+}
+
+ebtables_tables() {
+ for table in filter nat broute; do
+ if ${ebtables_bin} -t ${table} -L > /dev/null 2>&1; then
+ echo -n "${table} "
+ fi
+ done
+}
+
+set_table_policy() {
+ local chains table=$1 policy=$2
+ case ${table} in
+ nat) chains="PREROUTING POSTROUTING OUTPUT";;
+ broute) chains="BROUTING";;
+ filter) chains="INPUT FORWARD OUTPUT";;
+ *) chains="";;
+ esac
+ local chain
+ for chain in ${chains} ; do
+ ${ebtables_bin} -t ${table} -P ${chain} ${policy}
+ done
+}
+
+checkconfig() {
+ if [ ! -f ${ebtables_save} ] ; then
+ eerror "Not starting ebtables. First create some rules then run:"
+ eerror "/etc/init.d/ebtables save"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Loading ebtables state and starting bridge firewall"
+ ${ebtables_bin}-restore ${SAVE_RESTORE_OPTIONS} < "${ebtables_save}"
+ eend $?
+}
+
+stop() {
+ if [ "${SAVE_ON_STOP}" = "yes" ] ; then
+ save || return 1
+ fi
+ ebegin "Stopping bridge firewall"
+ local a
+ for a in $(ebtables_tables); do
+ set_table_policy $a ACCEPT
+
+ ${ebtables_bin} -t $a -F
+ ${ebtables_bin} -t $a -X
+ done
+ eend $?
+}
+
+reload() {
+ ebegin "Flushing bridge firewall"
+ local a
+ for a in $(ebtables_tables); do
+ ${ebtables_bin} -t $a -F
+ ${ebtables_bin} -t $a -X
+ done
+ eend $?
+
+ start
+}
+
+save() {
+ ebegin "Saving ebtables state"
+ touch "${ebtables_save}"
+ chmod 0600 "${ebtables_save}"
+ ${ebtables_bin}-save $(ebtables_tables) ${SAVE_RESTORE_OPTIONS} > "${ebtables_save}"
+ eend $?
+}
+
+panic() {
+ service_started ebtables && svc_stop
+
+ local a
+ ebegin "Dropping all packets forwarded on bridges"
+ for a in $(ebtables_tables); do
+ ${ebtables_bin} -t $a -F
+ ${ebtables_bin} -t $a -X
+
+ set_table_policy $a DROP
+ done
+ eend $?
+}