From 19464ae5294a99e166e1b53f2fcb51a0e8df8a9d0d40078143c11bbabdf7d310 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 9 Oct 2012 01:11:41 +0000 Subject: [PATCH] RHEL5 workarounds OBS-URL: https://build.opensuse.org/package/show/security:netfilter/iptables?expand=0&rev=57 --- iptables.spec | 4 +-- rhel5-libxt_limit.diff | 56 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 rhel5-libxt_limit.diff diff --git a/iptables.spec b/iptables.spec index 83f9275..1aab935 100644 --- a/iptables.spec +++ b/iptables.spec @@ -34,6 +34,7 @@ Source: http://netfilter.org/projects/iptables/files/%name-%version.tar. Source2: http://netfilter.org/projects/iptables/files/%name-%version.tar.bz2.sig Patch1: iptables-batch.patch Patch2: iptables-apply-mktemp-fix.patch +Patch3: rhel5-libxt_limit.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} BuildRequires: sgmltool @@ -138,8 +139,7 @@ xtables --variable=xtlibdir). tar -xf "%{S:0}" --use=bzip2; %setup -DTq %endif -%patch -P 1 -p1 -%patch2 -p1 +%patch -P 1 -P 2 -P 3 -p1 %build if [ ! -e configure ]; then diff --git a/rhel5-libxt_limit.diff b/rhel5-libxt_limit.diff new file mode 100644 index 0000000..2699f0d --- /dev/null +++ b/rhel5-libxt_limit.diff @@ -0,0 +1,56 @@ +From f525886fc628341809e9139f87eab92f3f6f31da Mon Sep 17 00:00:00 2001 +From: Jan Engelhardt +Date: Tue, 9 Oct 2012 00:14:17 +0200 +Subject: [PATCH] build: resolve compile abort in libxt_limit on RHEL5 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + + libxt_limit.c: In function 'print_rate': + libxt_limit.c:124: error: 'INFINITY' undeclared (first use in + this function) + +The default mode of glibc-2.15's sets +"-D_POSIX_C_SOURCE=200809L", and therefore "-D_ISOC99_SOURCE". However, +on þe olde RHEL 5's glibc-2.5, it only has "-D_POSIX_C_SOURCE=200112L". + +Explicitly draw in the definition of INFINITY by always defining +_ISOC99_SOURCE. By doing this, we are moving off of the default set, so +_BSD_SOURCE also needs to be explicitly set to get at IFNAMSIZ that is +used in xt_hashlimit.h. + +Signed-off-by: Jan Engelhardt +--- + extensions/libxt_hashlimit.c | 2 ++ + extensions/libxt_limit.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/extensions/libxt_hashlimit.c b/extensions/libxt_hashlimit.c +index 831345b..c5b8d77 100644 +--- a/extensions/libxt_hashlimit.c ++++ b/extensions/libxt_hashlimit.c +@@ -10,6 +10,8 @@ + * + * Error corections by nmalykh@bilim.com (22.01.2005) + */ ++#define _BSD_SOURCE 1 ++#define _ISOC99_SOURCE 1 + #include + #include + #include +diff --git a/extensions/libxt_limit.c b/extensions/libxt_limit.c +index 023500c..f75ef2f 100644 +--- a/extensions/libxt_limit.c ++++ b/extensions/libxt_limit.c +@@ -3,6 +3,8 @@ + * Jérôme de Vivie + * Hervé Eychenne + */ ++#define _BSD_SOURCE 1 ++#define _ISOC99_SOURCE 1 + #include + #include + #include +-- +1.7.10.4 +