[packages/tcpflow] added a bunch of Debian patches and BRs

gotar gotar at pld-linux.org
Tue Aug 25 18:37:19 CEST 2015


commit c9a107b844f5db5baa031832c0614deafcc3e638
Author: Tomasz Pala <gotar at pld-linux.org>
Date:   Tue Aug 25 18:36:46 2015 +0200

    added a bunch of Debian patches and BRs

 ...ebian-package-of-libhttp-parser-instead-o.patch | 48 ++++++++++++++++++++++
 0003-fixed-handling-of-fputc.patch                 | 28 +++++++++++++
 0004-fixed-handling-of-fputc.patch                 | 21 ++++++++++
 ...ttps-bugs.debian.org-cgi-bin-bugreport.cg.patch | 24 +++++++++++
 ...at-it-properly-gets-default-device-if-no-.patch | 44 ++++++++++++++++++++
 tcpflow.spec                                       | 22 +++++++++-
 6 files changed, 186 insertions(+), 1 deletion(-)
---
diff --git a/tcpflow.spec b/tcpflow.spec
index 0f862db..9983e36 100644
--- a/tcpflow.spec
+++ b/tcpflow.spec
@@ -2,18 +2,33 @@ Summary:	TCP Flow Recorder
 Summary(pl.UTF-8):	Program zapisujący ruch TCP
 Name:		tcpflow
 Version:	1.4.4
-Release:	1
+Release:	2
 License:	GPL v3
 Group:		Applications/Networking
 Source0:	http://www.digitalcorpora.org/downloads/tcpflow/%{name}-%{version}.tar.gz
 # Source0-md5:	f395fea6f5fe136543f4c982beff9cba
+Patch0:		0001-using-the-debian-package-of-libhttp-parser-instead-o.patch
+Patch1:		0003-fixed-handling-of-fputc.patch
+Patch2:		0004-fixed-handling-of-fputc.patch
+Patch3:		0005-fixed-per-https-bugs.debian.org-cgi-bin-bugreport.cg.patch
+Patch4:		0006-fixed-so-that-it-properly-gets-default-device-if-no-.patch
 URL:		http://www.circlemud.org/~jelson/software/tcpflow/
 BuildRequires:	autoconf
 BuildRequires:	automake
 BuildRequires:	boost-devel
+BuildRequires:	bzip2-devel
 BuildRequires:	cairo-devel
+BuildRequires:	expat-devel
+BuildRequires:	fontconfig-devel
+BuildRequires:	freetype-devel
+BuildRequires:	http-parser-devel
+BuildRequires:	libewf-devel
+BuildRequires:	libmd-devel
 BuildRequires:	libpcap-devel
+#BuildRequires:	libregex-devel
+#BuildRequires:	lightgrep-devel
 BuildRequires:	openssl-devel
+BuildRequires:	pixman-devel
 BuildRequires:	sqlite3-devel
 BuildRequires:	tre-devel
 BuildRequires:	zlib-devel
@@ -33,6 +48,11 @@ połączenie.
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 %{__aclocal} -I m4
diff --git a/0001-using-the-debian-package-of-libhttp-parser-instead-o.patch b/0001-using-the-debian-package-of-libhttp-parser-instead-o.patch
new file mode 100644
index 0000000..1e07ae3
--- /dev/null
+++ b/0001-using-the-debian-package-of-libhttp-parser-instead-o.patch
@@ -0,0 +1,48 @@
+From: Dima Kogan <dima at secretsauce.net>
+Date: Wed, 4 Dec 2013 19:37:48 -0800
+Subject: using the debian package of libhttp-parser instead of this one
+Forwarded: not needed
+
+---
+ src/Makefile.am   | 10 ++--------
+ src/scan_http.cpp |  2 +-
+ 2 files changed, 3 insertions(+), 9 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 67a6fa4..a80fc09 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -75,18 +75,12 @@ tcpflow_SOURCES = \
+ 	scan_wifiviz.cpp \
+ 	pcap_writer.h \
+ 	iptree.h \
+-	http-parser/http_parser.c \
+-	http-parser/http_parser.h \
+ 	mime_map.cpp \
+ 	mime_map.h 
+ 
++tcpflow_LDADD = -lhttp_parser
++
+ EXTRA_DIST =\
+-	http-parser/AUTHORS \
+-	http-parser/CONTRIBUTIONS \
+-	http-parser/LICENSE-MIT \
+-	http-parser/Makefile \
+-	http-parser/README.md \
+-	http-parser/http_parser.gyp \
+ 	wifipcap/README.txt \
+ 	wifipcap/TimeVal.cpp \
+ 	wifipcap/TimeVal.h \
+diff --git a/src/scan_http.cpp b/src/scan_http.cpp
+index 78abb98..2460694 100644
+--- a/src/scan_http.cpp
++++ b/src/scan_http.cpp
+@@ -11,7 +11,7 @@
+ #include "tcpip.h"
+ #include "tcpdemux.h"
+ 
+-#include "http-parser/http_parser.h"
++#include <http_parser.h>
+ 
+ #include "mime_map.h"
+ 
diff --git a/0003-fixed-handling-of-fputc.patch b/0003-fixed-handling-of-fputc.patch
new file mode 100644
index 0000000..048b08f
--- /dev/null
+++ b/0003-fixed-handling-of-fputc.patch
@@ -0,0 +1,28 @@
+From: Simson Garfinkel <simsong at acm.org>
+Date: Sun, 16 Feb 2014 11:24:01 -0500
+Subject: fixed handling of fputc
+Forwarded: yes. merged upstream at https://github.com/simsong/tcpflow/commit/6cfe1a4905b8801084ecff00ae794388128501af
+
+---
+ src/tcpip.cpp | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/tcpip.cpp b/src/tcpip.cpp
+index 603c127..ecad602 100644
+--- a/src/tcpip.cpp
++++ b/src/tcpip.cpp
+@@ -262,7 +262,13 @@ void tcpip::print_packet(const u_char *data, uint32_t length)
+     else if(demux.opt.output_strip_nonprint){
+ 	for(const u_char *cc = data;cc<data+length;cc++){
+ 	    if(isprint(*cc) || (*cc=='\n') || (*cc=='\r')){
+-		written += fputc(*cc,stdout);
++                int ret = fputc(*cc,stdout);
++                if(ret==EOF){
++                    std::cerr << "EOF on write to stdout\n";
++                    exit(1);
++                
++                }
++                written += ret;
+ 	    }
+ 	}
+     }
diff --git a/0004-fixed-handling-of-fputc.patch b/0004-fixed-handling-of-fputc.patch
new file mode 100644
index 0000000..8265207
--- /dev/null
+++ b/0004-fixed-handling-of-fputc.patch
@@ -0,0 +1,21 @@
+From: Simson Garfinkel <simsong at acm.org>
+Date: Sun, 16 Feb 2014 13:48:41 -0500
+Subject: fixed handling of fputc
+Forwarded: yes. merged upstream at https://github.com/simsong/tcpflow/commit/1aa7d8e5072175859b0a3c41264c84de14b25e55
+---
+ src/tcpip.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/tcpip.cpp b/src/tcpip.cpp
+index ecad602..86ad6df 100644
+--- a/src/tcpip.cpp
++++ b/src/tcpip.cpp
+@@ -268,7 +268,7 @@ void tcpip::print_packet(const u_char *data, uint32_t length)
+                     exit(1);
+                 
+                 }
+-                written += ret;
++                written += 1;
+ 	    }
+ 	}
+     }
diff --git a/0005-fixed-per-https-bugs.debian.org-cgi-bin-bugreport.cg.patch b/0005-fixed-per-https-bugs.debian.org-cgi-bin-bugreport.cg.patch
new file mode 100644
index 0000000..cb06824
--- /dev/null
+++ b/0005-fixed-per-https-bugs.debian.org-cgi-bin-bugreport.cg.patch
@@ -0,0 +1,24 @@
+From: Simson Garfinkel <simsong at acm.org>
+Date: Fri, 30 May 2014 07:07:50 -0400
+Subject: fixed per https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=736417
+Forwarded: yes. merged upstream at https://github.com/simsong/tcpflow/commit/7df3db6874fb1a596c1e9673eabaf15be81e59be
+
+---
+ src/tcpip.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/tcpip.cpp b/src/tcpip.cpp
+index 86ad6df..8a37413 100644
+--- a/src/tcpip.cpp
++++ b/src/tcpip.cpp
+@@ -268,8 +268,9 @@ void tcpip::print_packet(const u_char *data, uint32_t length)
+                     exit(1);
+                 
+                 }
+-                written += 1;
+ 	    }
++            written += 1; // treat even unprintable characters as "written". It
++                          // really means "processed"
+ 	}
+     }
+     else {
diff --git a/0006-fixed-so-that-it-properly-gets-default-device-if-no-.patch b/0006-fixed-so-that-it-properly-gets-default-device-if-no-.patch
new file mode 100644
index 0000000..eba860d
--- /dev/null
+++ b/0006-fixed-so-that-it-properly-gets-default-device-if-no-.patch
@@ -0,0 +1,44 @@
+From: Simson Garfinkel <simsong at acm.org>
+Date: Sun, 2 Feb 2014 16:18:45 -0500
+Subject: fixed so that it properly gets default device if no -i is given
+Forwarded: yes. merged upstream at https://github.com/simsong/tcpflow/commit/9abeb43451fff5543efdac769d1efea52d4dd084
+
+---
+ src/tcpflow.cpp | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/tcpflow.cpp b/src/tcpflow.cpp
+index 96bd38e..f5bd746 100644
+--- a/src/tcpflow.cpp
++++ b/src/tcpflow.cpp
+@@ -25,9 +25,6 @@
+ #include <sys/types.h>
+ #include <dirent.h>
+ 
+-
+-
+-
+ /* bring in inet_ntop if it is not present */
+ #define ETH_ALEN 6
+ #ifndef HAVE_INET_NTOP
+@@ -388,7 +385,7 @@ int main(int argc, char *argv[])
+ #endif
+ 
+     bool force_binary_output = false;
+-    const char *device = "<default>";
++    const char *device = 0;             // default device
+     const char *lockname = 0;
+     int need_usage = 0;
+     std::string reportfilename;
+@@ -649,7 +646,10 @@ int main(int argc, char *argv[])
+     be13::plugin::get_scanner_feature_file_names(feature_file_names);
+     feature_recorder_set fs(0);
+ 
+-    fs.init(feature_file_names,input_fname.size()>0 ? input_fname : device,demux.outdir);
++    const char *name = device;
++    if(input_fname.size()>0) name=input_fname.c_str();
++    if(name==0) name="<default>";
++    fs.init(feature_file_names,name,demux.outdir);
+     the_fs   = &fs;
+     demux.fs = &fs;
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/tcpflow.git/commitdiff/c9a107b844f5db5baa031832c0614deafcc3e638



More information about the pld-cvs-commit mailing list