Compare commits

..

1 Commits
master ... f19

Author SHA1 Message Date
Tom Callaway 695c2e3db7 add AUDIT module 2013-03-21 14:55:32 -04:00
6 changed files with 29 additions and 378 deletions

View File

@ -1,44 +0,0 @@
From 908d41de58d46262e719fff778950a6f893a02f8 Mon Sep 17 00:00:00 2001
From: Bart De Schuymer <bdschuym@pandora.be>
Date: Tue, 3 Jul 2012 18:47:32 +0000
Subject: [PATCH 01/16] add RARP and update iana url
---
userspace/ebtables2/ethertypes | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
index 5e700f663987..813177b74588 100644
--- a/ethertypes
+++ b/ethertypes
@@ -5,6 +5,7 @@
#
# This list could be found on:
# http://www.iana.org/assignments/ethernet-numbers
+# http://www.iana.org/assignments/ieee-802-numbers
#
# <name> <hexnumber> <alias1>...<alias35> #Comment
#
@@ -21,15 +22,16 @@ LAT 6004 # DEC LAT
DIAG 6005 # DEC Diagnostics
CUST 6006 # DEC Customer use
SCA 6007 # DEC Systems Comms Arch
-TEB 6558 # Trans Ether Bridging [RFC1701]
-RAW_FR 6559 # Raw Frame Relay [RFC1701]
+TEB 6558 # Trans Ether Bridging [RFC1701]
+RAW_FR 6559 # Raw Frame Relay [RFC1701]
+RARP 8035 # Reverse ARP [RFC903]
AARP 80F3 # Appletalk AARP
-ATALK 809B # Appletalk
+ATALK 809B # Appletalk
802_1Q 8100 8021q 1q 802.1q dot1q # 802.1Q Virtual LAN tagged frame
IPX 8137 # Novell IPX
NetBEUI 8191 # NetBEUI
IPv6 86DD ip6 # IP version 6
-PPP 880B # PPP
+PPP 880B # PPP
ATMMPOA 884C # MultiProtocol over ATM
PPP_DISC 8863 # PPPoE discovery messages
PPP_SES 8864 # PPPoE session messages
--
1.8.5.3

View File

@ -1,50 +0,0 @@
diff -up ebtables-v2.0.10-4/ebtables.8.lockdirfix ebtables-v2.0.10-4/ebtables.8
--- ebtables-v2.0.10-4/ebtables.8.lockdirfix 2016-01-18 11:13:21.707069702 -0500
+++ ebtables-v2.0.10-4/ebtables.8 2016-01-18 11:13:40.554953365 -0500
@@ -1103,7 +1103,7 @@ arp message and the hardware address len
.br
.SH FILES
.I /etc/ethertypes
-.I /var/lib/ebtables/lock
+.I /run/ebtables.lock
.SH ENVIRONMENT VARIABLES
.I EBTABLES_ATOMIC_FILE
.SH MAILINGLISTS
diff -up ebtables-v2.0.10-4/INSTALL.lockdirfix ebtables-v2.0.10-4/INSTALL
--- ebtables-v2.0.10-4/INSTALL.lockdirfix 2016-01-18 11:15:31.458268826 -0500
+++ ebtables-v2.0.10-4/INSTALL 2016-01-18 11:15:53.890130367 -0500
@@ -31,7 +31,7 @@ WHAT GETS INSTALLED AND WHAT OPTIONS ARE
copied to /etc/rc.d/init.d (change with option INITDIR)
- The ebtables configuration file (ebtables-config) is copied to /etc/sysconfig
- ebtables can use a lock file to enable concurrent execution of the ebtables
- tool. The standard location of the lock file is /var/lib/ebtables/lock.
+ tool. The standard location of the lock file is /run/ebtables.lock.
Include LOCKFILE=<<path-to-file>> if you want to use another file.
That's all
diff -up ebtables-v2.0.10-4/libebtc.c.lockdirfix ebtables-v2.0.10-4/libebtc.c
--- ebtables-v2.0.10-4/libebtc.c.lockdirfix 2016-01-18 11:12:14.347485472 -0500
+++ ebtables-v2.0.10-4/libebtc.c 2016-01-18 11:13:06.515163472 -0500
@@ -134,8 +134,8 @@ void ebt_list_extensions()
}
#ifndef LOCKFILE
-#define LOCKDIR "/var/lib/ebtables"
-#define LOCKFILE LOCKDIR"/lock"
+#define LOCKDIR "/run"
+#define LOCKFILE LOCKDIR"/ebtables.lock"
#endif
static int lockfd = -1, locked;
int use_lockfd;
diff -up ebtables-v2.0.10-4/Makefile.lockdirfix ebtables-v2.0.10-4/Makefile
--- ebtables-v2.0.10-4/Makefile.lockdirfix 2016-01-18 11:14:10.715767201 -0500
+++ ebtables-v2.0.10-4/Makefile 2016-01-18 11:15:20.506336425 -0500
@@ -5,7 +5,7 @@ PROGRELEASE:=4
PROGVERSION_:=2.0.10
PROGVERSION:=$(PROGVERSION_)-$(PROGRELEASE)
PROGDATE:=December\ 2011
-LOCKFILE?=/var/lib/ebtables/lock
+LOCKFILE?=/run/ebtables.lock
LOCKDIR:=$(shell echo $(LOCKFILE) | sed 's/\(.*\)\/.*/\1/')/
# default paths

View File

@ -1,69 +0,0 @@
commit 3a25ae2361da048f24524d8e63d70f4cd40444f3
Author: Sanket Shah <sanket.shah@cyberoam.com>
Date: Wed Jul 31 21:40:08 2013 +0200
Add --noflush command line support for ebtables-restore
diff --git a/ebtables-restore.c b/ebtables-restore.c
index ea02960..bb4d0cf 100644
--- a/ebtables-restore.c
+++ b/ebtables-restore.c
@@ -22,13 +22,25 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
+#include <getopt.h>
#include "include/ebtables_u.h"
+static const struct option options[] = {
+ {.name = "noflush", .has_arg = 0, .val = 'n'},
+ { 0 }
+};
+
static struct ebt_u_replace replace[3];
void ebt_early_init_once();
#define OPT_KERNELDATA 0x800 /* Also defined in ebtables.c */
+static void print_usage()
+{
+ fprintf(stderr, "Usage: ebtables-restore [ --noflush ]\n");
+ exit(1);
+}
+
static void copy_table_names()
{
strcpy(replace[0].name, "filter");
@@ -41,11 +53,20 @@ static void copy_table_names()
int main(int argc_, char *argv_[])
{
char *argv[EBTD_ARGC_MAX], cmdline[EBTD_CMDLINE_MAXLN];
- int i, offset, quotemode = 0, argc, table_nr = -1, line = 0, whitespace;
+ int i, offset, quotemode = 0, argc, table_nr = -1, line = 0, whitespace, c, flush = 1;
char ebtables_str[] = "ebtables";
- if (argc_ != 1)
- ebtrest_print_error("options are not supported");
+ while ((c = getopt_long(argc_, argv_, "n", options, NULL)) != -1) {
+ switch(c) {
+ case 'n':
+ flush = 0;
+ break;
+ default:
+ print_usage();
+ break;
+ }
+ }
+
ebt_silent = 0;
copy_table_names();
ebt_early_init_once();
@@ -68,7 +89,7 @@ int main(int argc_, char *argv_[])
ebtrest_print_error("table '%s' was not recognized", cmdline+1);
table_nr = i;
replace[table_nr].command = 11;
- ebt_get_kernel_table(&replace[table_nr], 1);
+ ebt_get_kernel_table(&replace[table_nr], flush);
replace[table_nr].command = 0;
replace[table_nr].flags = OPT_KERNELDATA; /* Prevent do_command from initialising replace */
continue;

View File

@ -1,11 +0,0 @@
[Unit]
Description=Ethernet Bridge Filtering tables
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/libexec/ebtables start
ExecStop=/usr/libexec/ebtables stop
[Install]
WantedBy=multi-user.target

View File

@ -2,35 +2,19 @@
Name: ebtables
Version: 2.0.10
Release: 28%{?dist}
Release: 8%{?dist}
Summary: Ethernet Bridge frame table administration tool
License: GPLv2+
Group: System Environment/Base
URL: http://ebtables.sourceforge.net/
Source0: http://downloads.sourceforge.net/ebtables/ebtables-v%{version}-%{ebminor}.tar.gz
Source1: ebtables-save
Source2: ebtables.systemd
Source3: ebtables.service
Requires(pre): /sbin/chkconfig
Requires(postun): /sbin/service
Patch0: ebtables-2.0.10-norootinst.patch
Patch3: ebtables-2.0.9-lsb.patch
Patch4: ebtables-2.0.10-linkfix.patch
Patch5: ebtables-2.0.0-audit.patch
# Upstream commit 5e126db0f
Patch6: 0001-add-RARP-and-update-iana-url.patch
# Move lockfile to /run/ebtables.lock
Patch7: ebtables-2.0.10-lockdirfix.patch
Patch8: ebtables-2.0.10-noflush.patch
BuildRequires: gcc
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%if 0%{?fedora} > 24
Conflicts: setup < 2.10.4-1
%endif
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
%description
Ethernet bridge tables is a firewalling tool to transparently filter network
@ -50,145 +34,60 @@ like iptables. There are no known incompatibility issues.
# extension modules need to link to libebtc.so for ebt_errormsg
%patch4 -p1 -b .linkfix
%patch5 -p1 -b .AUDIT
%patch6 -p1 -b .RARP
%patch7 -p1 -b .lockdirfix
%patch8 -p1 -b .noflush
# Convert to UTF-8
f=THANKS; iconv -f iso-8859-1 -t utf-8 $f -o $f.utf8 ; mv $f.utf8 $f
%build
make %{?_smp_mflags} CFLAGS="${RPM_OPT_FLAGS}" LIBDIR="/%{_lib}/ebtables" BINDIR="%{_sbindir}" MANDIR="%{_mandir}" LDFLAGS="${RPM_LD_FLAGS} -Wl,-z,now"
MY_CFLAGS=`echo $RPM_OPT_FLAGS -fPIC | sed -e 's/-fstack-protector//g'`
make %{?_smp_mflags} CFLAGS="$MY_CFLAGS" LIBDIR="/%{_lib}/ebtables" BINDIR="/sbin" MANDIR="%{_mandir}"
%install
mkdir -p %{buildroot}%{_initrddir}
mkdir -p %{buildroot}%{_unitdir}
install -p %{SOURCE3} %{buildroot}%{_unitdir}/
chmod -x %{buildroot}%{_unitdir}/*.service
mkdir -p %{buildroot}%{_libexecdir}
install -m0755 %{SOURCE2} %{buildroot}%{_libexecdir}/ebtables
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
make DESTDIR="%{buildroot}" LIBDIR="/%{_lib}/ebtables" BINDIR="%{_sbindir}" MANDIR="%{_mandir}" install
touch %{buildroot}%{_sysconfdir}/sysconfig/ebtables.filter
touch %{buildroot}%{_sysconfdir}/sysconfig/ebtables.nat
touch %{buildroot}%{_sysconfdir}/sysconfig/ebtables.broute
# Do not need the sysvinit
rm -rf %{buildroot}%{_initrddir}
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="/%{_lib}/ebtables" BINDIR="/sbin" MANDIR="%{_mandir}" install
touch $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ebtables.filter
touch $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ebtables.nat
touch $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ebtables.broute
# install ebtables-save bash script
rm -f %{buildroot}%{_sbindir}/ebtables-save
install %{SOURCE1} %{buildroot}%{_sbindir}/ebtables-save
rm -f $RPM_BUILD_ROOT/sbin/ebtables-save
install %{SOURCE1} $RPM_BUILD_ROOT/sbin/ebtables-save
# move libebtc.so into the ldpath
mv %{buildroot}/%{_lib}/ebtables/libebtc.so %{buildroot}/%{_lib}/
# Remove /etc/ethertypes (now part of setup)
rm -f %{buildroot}%{_sysconfdir}/ethertypes
# Prepare for Alternatives system
mv %{buildroot}%{_sbindir}/ebtables %{buildroot}%{_sbindir}/ebtables-legacy
touch %{buildroot}%{_sbindir}/ebtables
%post
%systemd_post ebtables.service
%?ldconfig
if [ "$(readlink -e %{_sbindir}/ebtables)" == %{_sbindir}/ebtables ]; then
rm -f %{_sbindir}/ebtables
fi
%{_sbindir}/update-alternatives --install \
%{_sbindir}/ebtables ebtables %{_sbindir}/ebtables-legacy 10
/sbin/chkconfig --add ebtables
/sbin/ldconfig
%preun
%systemd_preun ebtables.service
%postun
%systemd_postun_with_restart ebtables.service
%?ldconfig
if [ $1 -eq 0 ]; then
%{_sbindir}/update-alternatives --remove ebtables %{_sbindir}/ebtables-legacy
/sbin/service ebtables stop &>/dev/null || :
/sbin/chkconfig --del ebtables
fi
%postun
if [ $1 -ge 1 ]; then
/sbin/service ebtables condrestart &> /dev/null || :
fi
/sbin/ldconfig
%files
%license COPYING
%doc ChangeLog THANKS
%defattr(-, root, root, 0755)
%doc ChangeLog COPYING THANKS
%doc %{_mandir}/man8/ebtables.8*
%if 0%{?fedora} <= 24
%{_sysconfdir}/ethertypes
%endif
%config(noreplace) %{_sysconfdir}/ethertypes
%config(noreplace) %{_sysconfdir}/sysconfig/ebtables-config
%{_unitdir}/ebtables.service
%{_libexecdir}/ebtables
%{_initrddir}/ebtables
/%{_lib}/libebtc.so
/%{_lib}/ebtables/
%{_sbindir}/ebtables-*
%ghost %{_sbindir}/ebtables
/sbin/ebtables*
%ghost %{_sysconfdir}/sysconfig/ebtables.filter
%ghost %{_sysconfdir}/sysconfig/ebtables.nat
%ghost %{_sysconfdir}/sysconfig/ebtables.broute
%changelog
* Sun Jul 22 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2.0.10-28
- Add gcc dep, spec cleanups
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jul 10 2018 Phil Sutter <psutter@redhat.com> - 2.0.10-26
- Replace calls to ldconfig with newly introduced macro.
- Install binaries in /usr/sbin instead of /sbin.
- Make use of Alternatives system.
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Fri Jul 22 2016 Thomas Woerner <twoerner@redhat.com> - 2.0.10-21
- /etc/ethertypes has been moved into the setup package for F-25+.
(RHBZ#1329256)
* Mon May 9 2016 Thomas Woerner <twoerner@redhat.com> - 2.0.10-20
- add upstream --noflush option patch for ebtables-restore
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Mon Jan 18 2016 Tom Callaway <spot@fedoraproject.org> - 2.0.10-18
- Move lock file to /run/ebtables.lock (bz 1290327)
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.10-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.10-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Tue Jun 24 2014 Tom Callaway <spot@fedoraproject.org> - 2.0.10-15
- create and own /var/lib/ebtables (bz 1093361)
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.10-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Mon Mar 31 2014 Tom Callaway <spot@fedoraproject.org> - 2.0.10-13
- use standard optflags and ldflags (bz 1071993)
* Wed Feb 19 2014 Tom Callaway <spot@fedoraproject.org> - 2.0.10-12
- remove executable bit from systemd service file
- add RARP type to ethertypes (bz 1060537)
* Wed Aug 21 2013 Tom Callaway <spot@fedoraproject.org> - 2.0.10-11
- convert to systemd
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.10-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Mar 21 2013 Tom Callaway <spot@fedoraproject.org> - 2.0.10-8
- add audit module

View File

@ -1,74 +0,0 @@
#!/bin/bash
RETVAL=0
initialize() {
# Initialize $TYPE tables
echo -n $" $TYPE tables: "
if [ -r /etc/sysconfig/ebtables.$TYPE ]; then
/sbin/ebtables -t $TYPE --atomic-file /etc/sysconfig/ebtables.$TYPE --atomic-commit > /dev/null || RETVAL=1
else
echo -n "not configured"
fi
if [ $RETVAL -eq 0 ]; then
echo -n $"[ OK ]"
echo -ne "\r"
else
echo -n $"[FAILED]"
echo -ne "\r"
fi
}
case $1 in
start)
# Initialize filter tables
TYPE=filter
initialize
# Initialize NAT tables
echo
TYPE=nat
initialize
# Initialize broute tables
echo
TYPE=broute
initialize
;;
stop)
/sbin/ebtables -t filter --init-table || RETVAL=1
/sbin/ebtables -t nat --init-table || RETVAL=1
/sbin/ebtables -t broute --init-table || RETVAL=1
for mod in $(grep -E '^(ebt|ebtable)_' /proc/modules | cut -f1 -d' ') ebtables; do
/sbin/rmmod $mod || RETVAL=1
done
if [ $RETVAL -eq 0 ]; then
echo -n $"[ OK ]"
echo -ne "\r"
else
echo -n $"[FAILED]"
echo -ne "\r"
fi
;;
save)
echo -n $"Saving Ethernet bridge filtering (ebtables): "
/sbin/ebtables -t filter --atomic-file /etc/sysconfig/ebtables.filter --atomic-save || RETVAL=1
/sbin/ebtables -t nat --atomic-file /etc/sysconfig/ebtables.nat --atomic-save || RETVAL=1
/sbin/ebtables -t broute --atomic-file /etc/sysconfig/ebtables.broute --atomic-save || RETVAL=1
if [ $RETVAL -eq 0 ]; then
echo -n $"[ OK ]"
echo -ne "\r"
else
echo -n $"[FAILED]"
echo -ne "\r"
fi
;;
*)
echo "usage: ${0##*/} {start|stop|save}" >&2
exit 1
;;
esac
# vim:set ts=2 sw=2 ft=sh et: