[p0f] Patch build.sh to use correct compiler flags. Fixes bug #1037237

Kevin Fenzi kevin at fedoraproject.org
Tue Dec 3 04:19:49 UTC 2013


commit 1d74c7eab50ea2ca172700c8607235bf7d81d504
Author: Kevin Fenzi <kevin at scrye.com>
Date:   Mon Dec 2 21:19:33 2013 -0700

    Patch build.sh to use correct compiler flags. Fixes bug #1037237

 p0f-3.06b-compiler.patch |   37 +++++++++++++++++++++++++++++++++++++
 p0f.spec                 |    8 +++++++-
 2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/p0f-3.06b-compiler.patch b/p0f-3.06b-compiler.patch
new file mode 100644
index 0000000..50c7f31
--- /dev/null
+++ b/p0f-3.06b-compiler.patch
@@ -0,0 +1,37 @@
+diff -Nur p0f-3.06b.orig/build.sh p0f-3.06b/build.sh
+--- p0f-3.06b.orig/build.sh	2012-09-29 22:51:20.000000000 -0600
++++ p0f-3.06b/build.sh	2013-12-02 21:06:18.758155005 -0700
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/bash -x
+ #
+ # p0f - build script
+ # ------------------
+@@ -13,12 +13,12 @@
+ 
+ test "$CC" = "" && CC="gcc"
+ 
+-BASIC_CFLAGS="-Wall -Wno-format -I/usr/local/include/ \
+-              -I/opt/local/include/ -DVERSION=\"$VERSION\" $CFLAGS"
++BASIC_CFLAGS="-Wall -Werror=format-security \
++              -DVERSION=\"$VERSION\" $CFLAGS"
+ 
+-BASIC_LDFLAGS="-L/usr/local/lib/ -L/opt/local/lib $LDFLAGS"
++BASIC_LDFLAGS="$LDFLAGS"
+ 
+-USE_CFLAGS="-fstack-protector-all -fPIE -D_FORTIFY_SOURCE=2 -g -ggdb \
++USE_CFLAGS="-fPIE -g -ggdb \
+             $BASIC_CFLAGS"
+ 
+ USE_LDFLAGS="-Wl,-z,relro -pie $BASIC_LDFLAGS"
+@@ -81,8 +81,8 @@
+ elif [ "$1" = "all" -o "$1" = "" ]; then
+ 
+   echo "[+] Configuring production build."
+-  BASIC_CFLAGS="$BASIC_CFLAGS -O3"
+-  USE_CFLAGS="$USE_CFLAGS -O3"
++  BASIC_CFLAGS="$BASIC_CFLAGS -O2"
++  USE_CFLAGS="$USE_CFLAGS -O2"
+ 
+ elif [ "$1" = "debug" ]; then
+ 
diff --git a/p0f.spec b/p0f.spec
index 90e96a9..68e7f72 100644
--- a/p0f.spec
+++ b/p0f.spec
@@ -1,12 +1,14 @@
 Name: p0f
 Version: 3.06b
-Release: 3%{?dist}
+Release: 4%{?dist}
 
 Summary: Versatile passive OS fingerprinting tool
 Group: Applications/Internet
 License: LGPLv2+
 URL: http://lcamtuf.coredump.cx/p0f.shtml
 Source: http://lcamtuf.coredump.cx/p0f3/releases/p0f-%{version}.tgz
+# Fix up build script to use proper flags
+Patch1: p0f-3.06b-compiler.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: libpcap-devel
 
@@ -19,6 +21,7 @@ uptime, other guy's network hookup (DSL, OC3, avian carriers) and his ISP.
 
 %prep
 %setup -q
+%patch1 -p1
 
 %build
 make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -DFP_FILE=\"%{_sysconfdir}/p0f/p0f.fp\""
@@ -52,6 +55,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Mon Dec 02 2013 Kevin Fenzi <kevin at scrye.com> 3.06b-4
+- Patch build.sh to use correct compiler flags. Fixes bug #1037237
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.06b-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list