diff --git a/net-misc/tcpick/Manifest b/net-misc/tcpick/Manifest index 36cfc8638..5a889a6ff 100644 --- a/net-misc/tcpick/Manifest +++ b/net-misc/tcpick/Manifest @@ -1,2 +1,10 @@ -DIST tcpick-0.2.1.tar.gz 175871 RMD160 8d4dd48c639e52ef681cd64c366a99c296171f06 SHA1 02892932f462b6ff3f62e5930a0644c44cdef8c9 SHA256 cf3c3814518f5565df3884d07e1e3015d88ac1dbfe3885635dd6e67d6ce46dd2 -EBUILD tcpick-0.2.1.ebuild 443 RMD160 121a1900de83a3fcaa461c667ca1805e2d5256e5 SHA1 03d34fe5d01c6e25db4252e00999ee60ca0c8208 SHA256 dcf5c27fad13e5b375102e2feb5341b815835dfc6860d89ded61d41ae8ac38b4 +AUX tcpick-0.2.1-CVE-2006-0048.patch 1147 SHA256 134f583149adb1bfb940d63f669ad9df17bf1d624f51bf4d5949c47aa463bf5d SHA512 206a140a59b5238481769a94709ac82291743d3bc1e9515faf745dd37b4f785b7fc2159155ad9fb5df4a24f146e4d8ba9ddb9612b6c4f5447b354f950124781c WHIRLPOOL 120a467227b454d20f963a860ad7e64981e17a42e57bf4bea4d1a29abfbad575380c3f5c8a439bced1c09c4e75cce6af96b5227e5e42cbe02120dcf20a3ff7fa +AUX tcpick-0.2.1-cpu-loop.patch 1391 SHA256 58a278d4d58d8141eeecc731d7b17c99ae93a7814aad110f9d2af0018e43c2f0 SHA512 1702baa084f761a4b2fe26d33674f86d88df612ca0130b4586c1ba4d656e3505a1d28a6b78ffccc0b8f6cdef634e30a927e287a7476d7bc7a6c03b55438f6168 WHIRLPOOL 446903482d9e5291adaa8a605807252410c7a58ec17845a3279d7851ebe2b1fb4c965486af212be0a12ce310ae87cff4c9975ed93ebc22a8f9b91fd8fef72f5a +AUX tcpick-0.2.1-pointers.patch 2931 SHA256 3ef191d93dc688c9a243f30ca0777f75c0fd6016eb9a7142373974b11eb0d762 SHA512 c2d8198ac20b2199a8eb6a3f818bbb08b64113f3e77218c2c80b2df635da4eeea733e7af190503aef44f2c5c4c296b3a6a5e882c78d66156e6eb9a0027f7a290 WHIRLPOOL ad717d32800bec6532e6aef547e275368ac5e152a75daf196672ef06af1485006add065d65b9a53c14705b16e9abc6578da3907bdb5c01114685c4562a6cec08 +AUX tcpick-0.2.1-ppc.patch 614 SHA256 047040d0eafce1b19611fddae2de6923bb0d4992904e676dc28484bf36278557 SHA512 e487c1fe15a59a06df50cd28f2c67dac43ff783f577aaa9117ddcdc0427a3d9fa511210677388d22fbdaa882aeda67af3e038749198cdd9d939f5426acb216da WHIRLPOOL 6357fbd3f8460102ccb65a671261776abe918844bdb88d3b7c0214623d539e89237a9cafcdc23b3b8c131f2c405a22e0ca502a033b0a9adec247092111fa4bd1 +AUX tcpick-0.2.1-timezone.patch 607 SHA256 c8ca49999d3d4142f2c450fa725d67f40c38a2af8a05d458b4d971fbd3a96eaa SHA512 f40aed8ce7966c1cedca96c7e4ebb91cfa814d0daeb2e52657a324fe594dac00f90d4f19018de3a789d789fc2dcac93a994cb358f3f2072129cd73db5ada6a89 WHIRLPOOL 7f311db416704001ce32f3827ef2cbd523b0dfbbf5064fe8a8b15795372a1da6bc74babb557c001d5c73317212c7135e2e5b766339bfd864c4af07d51dfcee06 +AUX tcpick_0.2.1-amd.patch 7050 SHA256 6e6046048c7a57e2d10d2859af61eb8bbd19c7b53356cc169d1a58ffce45d9e9 SHA512 07afd8ae4142273847b8899d3d89e3294b87940462f320a14b059c6affcf7a34a503ab2a13a48d9541f2aa2ec33d57174255a8eaa707570f731a3f56c2dfc7a0 WHIRLPOOL 4d885e4abab1bc6a6bb235527ce08dcb98ec1bef18f9432bb027fd02514847bbe034c4c4fa6c8af0f6c595eba62254b4d31a35e19c8fee275f850d52fb62b416 +AUX tcpick_0.2.1-shortpkts.patch 3094 SHA256 362fb4409bf915ff2711d90261c4384b01a623488a6eace97304cbcd19a7f064 SHA512 7baedad24d82d3514c82b802de0063a56890db3850bf565f85ba1baf5a2a89ebf62f2bf871d43a1eb445dd7d46f7fda8d4075d0c959e65d1a5c1b945b4b4a8a7 WHIRLPOOL 5edb2accf7da28e15643552786e5c7477da498126f27f78fbc601b9c8fe2765266ebf7600a835b2e915d5f166ec39065d376494621f8a91a4b4531fad5dc7736 +DIST tcpick-0.2.1.tar.gz 175871 SHA256 cf3c3814518f5565df3884d07e1e3015d88ac1dbfe3885635dd6e67d6ce46dd2 SHA512 2dd3f2e54c6c86b4d1d320113b96977a6ffab2b0ea2b4e2b39585b18a28a314f9fd92d9e874d0350cee3fa54a99b48959c6b0db830a59d3c896c4561beb863b0 WHIRLPOOL 8332029098ecc9f5068c22ee78e1e3a38699d1e0fe176c5e378d5cd0b48578aea754cf6b393a1978d00bc5a01ca35d6bdf9bf1f3120eabeca8c3751ce4be5e3a +EBUILD tcpick-0.2.1-r1.ebuild 898 SHA256 94f6d4fe428041690537e4feda662e23dbb94ba8aa425c939f3c111b3f541c73 SHA512 d767dab9b011c274012c50e9e2b3824a5cb8d5f68a0d16c59e3eea844c25dfcaa0f6bc53005e3e8e214c81b23fa34f0ae187c897665fa92878b5af2d76f8afb0 WHIRLPOOL ce69925edbd1f3195782ae6f349e51211b7b117c0b178aea772151543020ad54993c4709bc4c3bf9ed421d11da282aabbad33853c31feec264545a868242cb06 +EBUILD tcpick-0.2.1.ebuild 443 SHA256 dcf5c27fad13e5b375102e2feb5341b815835dfc6860d89ded61d41ae8ac38b4 SHA512 73f1030c8be83215237e71c4d134ebd5886b713ab4e22a6d8999e1a78dd1a0b95c2b9a12d1f3ea09f2f0f488e0b48f08f3a94db4e901d7d3ec244e55755e278d WHIRLPOOL 9a78ebfc3134cb2039375f465e8aafd26c510e23be139faeb6ef328dc9c6388e726fba767cdfcb3864d931b7218d4d72e8939d5a76802d17c2f89cf2608eaf8d diff --git a/net-misc/tcpick/files/tcpick-0.2.1-CVE-2006-0048.patch b/net-misc/tcpick/files/tcpick-0.2.1-CVE-2006-0048.patch new file mode 100644 index 000000000..b752087db --- /dev/null +++ b/net-misc/tcpick/files/tcpick-0.2.1-CVE-2006-0048.patch @@ -0,0 +1,27 @@ +Re-merged patch by Robert Scheck for tcpick <= 0.2.1, +which works around the segmentation fault by aborting tcpick. + +The patch is originally from Cédric Delfosse after the report +by Andrea Barisani about the possibility maybe to trigger +remotely the segfault condition in tcpick. It's also a better temporary fix rather +the initial quick fix posted at the tcpick mailing list, which makes tcpick nearly +unusable. + +Further information: + - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-0048 + - http://sourceforge.net/mailarchive/forum.php?thread_id=9989610&forum_id=37151 + - http://www.securityfocus.com/bid/17665 + - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=360571 + +--- tcpick-0.2.1/src/write.c 2005-01-09 00:54:47.000000000 +0100 ++++ tcpick-0.2.1/src/write.c.CVE-2006-0048 2006-09-09 23:43:07.000000000 +0200 +@@ -241,6 +241,9 @@ + if( flags.separator && ( out == stdout ) ) /* FIXME: sucks? */ + color( c_SEPARATOR, stdout, SEPARATOR "\n" ); + ++ if (buflen < 0) ++ buflen = 0; ++ + switch ( flavour ) { + case HEX_ASCII_DUMP: + out_xa( out, buf, buflen ); diff --git a/net-misc/tcpick/files/tcpick-0.2.1-cpu-loop.patch b/net-misc/tcpick/files/tcpick-0.2.1-cpu-loop.patch new file mode 100644 index 000000000..f9ebe06c5 --- /dev/null +++ b/net-misc/tcpick/files/tcpick-0.2.1-cpu-loop.patch @@ -0,0 +1,43 @@ +Re-merged patch by Robert Scheck for tcpick <= 0.2.1, +which fixes a double-free error detected by glibc on runtime during the execute of +commands like "tcpick -wu -p -i eth0" causing a infinite loop after recording some +sessions. The patch is originally from Cédric Delfosse . + +Further information: + - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=319864 + - http://sourceforge.net/mailarchive/message.php?msg_id=20647778 + +--- tcpick-0.2.1/src/tracker.c 2004-12-31 14:53:30.000000000 +0100 ++++ tcpick-0.2.1/src/tracker.c.cpu-loop 2006-09-10 00:17:59.000000000 +0200 +@@ -99,8 +99,11 @@ + if( curr->next == NULL ) + last_conn = prev_ring; + +- free_desc( &(curr->client) ); +- free_desc( &(curr->server) ); ++ free_desc( &(curr->client), 1); ++ if (flags.writer.type == UNIQUE) ++ free_desc( &(curr->server), 0); ++ else ++ free_desc( &(curr->server), 1); + S_free( curr ); + + conn = first_conn; +@@ -124,7 +127,7 @@ + count_opened--; + } + +-int free_desc( struct HOST_DESC * desc ) ++int free_desc( struct HOST_DESC * desc, int freedescfilename ) + /* frees the host descriptor and closes the file */ + { + struct FRAGMENT * tmp; +@@ -134,7 +137,7 @@ + if (flags.writer.type == UNIQUE) + desc->oth->file = NULL; + } +- if( desc->filename ) { ++ if( desc->filename && freedescfilename ) { + S_free( desc->filename ); + desc->filename = NULL; + } diff --git a/net-misc/tcpick/files/tcpick-0.2.1-pointers.patch b/net-misc/tcpick/files/tcpick-0.2.1-pointers.patch new file mode 100644 index 000000000..7ff1f79a6 --- /dev/null +++ b/net-misc/tcpick/files/tcpick-0.2.1-pointers.patch @@ -0,0 +1,94 @@ +Re-merged patch by Robert Scheck for tcpick <= 0.2.1, +to fix multiple "implicitly converted to pointer" messages during build; patch is +originally from Dann Frazier . + +Further information: + - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=326927 + +--- tcpick-0.2.1/src/display.c 2004-12-31 14:53:30.000000000 +0100 ++++ tcpick-0.2.1/src/display.c.pointers 2006-09-10 00:04:55.000000000 +0200 +@@ -28,6 +28,7 @@ + /* FIXME: most code is duplicated: find a better solution! */ + + #include "tcpick.h" ++#include "lookup.h" + #include "extern.h" + + char * +--- tcpick-0.2.1/src/tcpick.c 2005-01-18 13:25:36.000000000 +0100 ++++ tcpick-0.2.1/src/tcpick.c.pointers 2006-09-10 00:06:02.000000000 +0200 +@@ -49,6 +49,7 @@ + + #include "tcpick.h" + #include "globals.h" ++#include "datalink.h" + + char *errbuf[PCAP_ERRBUF_SIZE]; + struct bpf_program filter_compiled; +--- tcpick-0.2.1/src/write.c 2005-01-09 00:54:47.000000000 +0100 ++++ tcpick-0.2.1/src/write.c.pointers 2006-09-10 00:06:47.000000000 +0200 +@@ -25,8 +25,11 @@ + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + ++#define _GNU_SOURCE ++#include + #include "tcpick.h" + #include "extern.h" ++#include "lookup.h" + + __inline__ char * + avail_filename(struct CONN * conn_ptr, +--- tcpick-0.2.1/src/lookup.h 2004-12-31 14:53:30.000000000 +0100 ++++ tcpick-0.2.1/src/lookup.h.pointers 2006-09-10 00:07:38.000000000 +0200 +@@ -26,6 +26,8 @@ + * USA. + */ + ++#ifndef _LOOKUP_H ++#define _LOOKUP_H + + struct _l_node /* the node/leaf of the tree */ + { +@@ -40,3 +42,9 @@ + char * name; + struct in_addr ip; + }; ++ ++char *lookup(struct in_addr ia); ++struct _l_node *_l_alloc(struct in_addr, char *); ++char *_l_get(struct in_addr); ++ ++#endif +--- tcpick-0.2.1/src/datalink.h 1970-01-01 01:00:00.000000000 +0100 ++++ tcpick-0.2.1/src/datalink.h.pointers 2006-09-10 00:08:22.000000000 +0200 +@@ -0,0 +1,29 @@ ++/* ++ * datalink.h -- calculates datalink offsets ++ * Part of the tcpick project ++ * ++ * Author: Francesco Stablum ++ * ++ * Copyright (C) 2003, 2004 Francesco Stablum ++ * Licensed under the GPL ++ * ++ */ ++ ++/* ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at you option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ * See the GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, ++ * USA. ++ */ ++ ++char *datalink2str(int dl_id); diff --git a/net-misc/tcpick/files/tcpick-0.2.1-ppc.patch b/net-misc/tcpick/files/tcpick-0.2.1-ppc.patch new file mode 100644 index 000000000..3cf44de29 --- /dev/null +++ b/net-misc/tcpick/files/tcpick-0.2.1-ppc.patch @@ -0,0 +1,18 @@ +Re-merged patch by Robert Scheck for tcpick <= 0.2.1, +because tcpick is possibly unusable on ppc architectures while it never gets past +the getopt loop; patch is originally from Cédric Delfosse . + +Further information: + - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327327 + +--- tcpick-0.2.1/src/args.c 2005-01-16 16:19:35.000000000 +0100 ++++ tcpick-0.2.1/src/args.c.ppc 2006-09-09 23:51:42.000000000 +0200 +@@ -149,7 +149,7 @@ + void + parse_args(int argc, char ** argv) + { +- char opt; ++ int opt; + + #ifdef HAVE_GETOPT_LONG + static struct option long_options[]= diff --git a/net-misc/tcpick/files/tcpick-0.2.1-timezone.patch b/net-misc/tcpick/files/tcpick-0.2.1-timezone.patch new file mode 100644 index 000000000..ad1c507aa --- /dev/null +++ b/net-misc/tcpick/files/tcpick-0.2.1-timezone.patch @@ -0,0 +1,17 @@ +Fix a typo. Timezone is a bit longer on 64bit and it triggers +a FORTIFY_SOURCE abort. + +Lubomir Rintel + +diff -up tcpick-0.2.1/src/time.c.timezone tcpick-0.2.1/src/time.c +--- tcpick-0.2.1/src/time.c.timezone 2009-03-29 17:21:06.512148187 +0200 ++++ tcpick-0.2.1/src/time.c 2009-03-29 17:21:34.145151786 +0200 +@@ -42,7 +42,7 @@ char * time_ascii(char * ret) + tzp = (struct timezone * ) S_malloc( sizeof(struct timezone) ); + + memset(tp, 0, sizeof(struct timeval)); +- memset(tzp, 0, sizeof(struct timeval)); ++ memset(tzp, 0, sizeof(struct timezone)); + + if(gettimeofday(tp, tzp)) { + diff --git a/net-misc/tcpick/files/tcpick_0.2.1-amd.patch b/net-misc/tcpick/files/tcpick_0.2.1-amd.patch new file mode 100644 index 000000000..0bfd598da --- /dev/null +++ b/net-misc/tcpick/files/tcpick_0.2.1-amd.patch @@ -0,0 +1,268 @@ +diff -urN tcpick-0.2.1.org/src/args.c tcpick-0.2.1/src/args.c +--- tcpick-0.2.1.org/src/args.c 2005-01-16 16:19:35.000000000 +0100 ++++ tcpick-0.2.1/src/args.c 2014-01-12 13:36:15.991301604 +0100 +@@ -149,7 +149,7 @@ + void + parse_args(int argc, char ** argv) + { +- char opt; ++ int opt; + + #ifdef HAVE_GETOPT_LONG + static struct option long_options[]= +diff -urN tcpick-0.2.1.org/src/datalink.c tcpick-0.2.1/src/datalink.c +--- tcpick-0.2.1.org/src/datalink.c 2004-12-31 14:53:30.000000000 +0100 ++++ tcpick-0.2.1/src/datalink.c 2014-01-12 13:57:01.697926978 +0100 +@@ -28,6 +28,8 @@ + + #include "tcpick.h" + #include "extern.h" ++#include "datalink.h" ++ + + char *datalink2str(int dl_id) + { +diff -urN tcpick-0.2.1.org/src/datalink.h tcpick-0.2.1/src/datalink.h +--- tcpick-0.2.1.org/src/datalink.h 1970-01-01 01:00:00.000000000 +0100 ++++ tcpick-0.2.1/src/datalink.h 2014-01-12 13:55:20.521263666 +0100 +@@ -0,0 +1,39 @@ ++/* ++ * datalink.h -- header for calculating datalink offsets ++ * Part of the tcpick project ++ * ++ * Author: Francesco Stablum ++ * Jochen Schlick ++ * ++ * Copyright (C) 2003, 2004 Francesco Stablum ++ * Copyright (C) 2014 Jochen Schlick ++ * ++ * Licensed under the GPL ++ * ++ */ ++ ++/* ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at you option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ * See the GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, ++ * USA. ++ */ ++ ++#ifndef _DATALINK_H ++#define _DATALINK_H ++ ++ ++char *datalink2str(int dl_id); ++ ++ ++#endif +diff -urN tcpick-0.2.1.org/src/debug.c tcpick-0.2.1/src/debug.c +--- tcpick-0.2.1.org/src/debug.c 2004-12-31 14:53:30.000000000 +0100 ++++ tcpick-0.2.1/src/debug.c 2014-01-12 14:39:16.244509624 +0100 +@@ -32,7 +32,7 @@ + print_conn_chain (struct CONN * f) + { + while (f) { +- printf ("%x->",f); ++ printf ("%p->",f); + + if (f == f->next) { + printf ("inf\n"); +@@ -48,7 +48,7 @@ + print_fragment_chain(struct FRAGMENT * f) + { + while (f) { +- printf ("%x(%i,%i)->",f,f->off,f->len); ++ printf ("%p(%i,%i)->",f,f->off,f->len); + + if (f == f->next) { + printf ("inf\n"); +diff -urN tcpick-0.2.1.org/src/display.c tcpick-0.2.1/src/display.c +--- tcpick-0.2.1.org/src/display.c 2004-12-31 14:53:30.000000000 +0100 ++++ tcpick-0.2.1/src/display.c 2014-01-12 13:29:48.747981116 +0100 +@@ -29,6 +29,8 @@ + + #include "tcpick.h" + #include "extern.h" ++#include "lookup.h" ++ + + char * + status2str( enum STATUS status ) +diff -urN tcpick-0.2.1.org/src/lookup.h tcpick-0.2.1/src/lookup.h +--- tcpick-0.2.1.org/src/lookup.h 2004-12-31 14:53:30.000000000 +0100 ++++ tcpick-0.2.1/src/lookup.h 2014-01-12 13:27:07.537986460 +0100 +@@ -26,6 +26,11 @@ + * USA. + */ + ++#ifndef _LOOKUP_H ++#define _LOOKUP_H ++ ++ ++ + + struct _l_node /* the node/leaf of the tree */ + { +@@ -40,3 +45,20 @@ + char * name; + struct in_addr ip; + }; ++ ++ ++char * ++lookup(struct in_addr ia); ++ ++char * ++getportname(u_int16_t port); ++ ++struct _l_node * ++_l_alloc(struct in_addr, char *); ++ ++char * ++_l_get(struct in_addr); ++ ++ ++ ++#endif +diff -urN tcpick-0.2.1.org/src/tcpick.c tcpick-0.2.1/src/tcpick.c +--- tcpick-0.2.1.org/src/tcpick.c 2005-01-18 13:25:36.000000000 +0100 ++++ tcpick-0.2.1/src/tcpick.c 2014-01-12 16:16:58.684002152 +0100 +@@ -49,6 +49,7 @@ + + #include "tcpick.h" + #include "globals.h" ++#include "datalink.h" + + char *errbuf[PCAP_ERRBUF_SIZE]; + struct bpf_program filter_compiled; +@@ -180,7 +181,8 @@ + } + + } else if( readfile != NULL ) { +- setuid(getuid()); ++ int dummy; ++ dummy = setuid(getuid()); + msg( 1, c_INTERFACE, + "%s: reading from %s", + TCPICK_NAME, readfile ); +@@ -232,13 +234,19 @@ + + /* compiling the filter */ + if( filter != NULL ) { ++ bpf_u_int32 nm; + msg(1, c_SETTING, "setting filter: \"%s\"",filter); + ++ if ( net == NULL) { ++ nm = PCAP_NETMASK_UNKNOWN; ++ } else { ++ nm = (int) inet_addr(net); ++ } + if( ( pcap_compile( descr, + &filter_compiled, + filter, + 0, +- (int)net ++ nm + ) == -1) ) + err("error compiling filter \"%s\"",filter); + +diff -urN tcpick-0.2.1.org/src/time.c tcpick-0.2.1/src/time.c +--- tcpick-0.2.1.org/src/time.c 2005-01-09 01:21:44.000000000 +0100 ++++ tcpick-0.2.1/src/time.c 2014-01-12 14:47:38.897826291 +0100 +@@ -42,7 +42,7 @@ + tzp = (struct timezone * ) S_malloc( sizeof(struct timezone) ); + + memset(tp, 0, sizeof(struct timeval)); +- memset(tzp, 0, sizeof(struct timeval)); ++ memset(tzp, 0, sizeof(struct timezone)); + + if(gettimeofday(tp, tzp)) { + +@@ -54,18 +54,18 @@ + switch (flags.displaytime) { + + case ONLYTIME: +- sprintf(ret,"%2.2d:%2.2d:%2.2d.%6.6d", ++ sprintf(ret,"%2.2d:%2.2d:%2.2d.%6.6ld", + brokentime->tm_hour, + brokentime->tm_min, + brokentime->tm_sec, +- tp->tv_usec ++ (long)tp->tv_usec + ); + break; + + case TIMEDATE: + sprintf(ret, + "%2.2d-%2.2d-%2.2d " /* date */ +- "%2.2d:%2.2d:%2.2d.%6.6d", /* time */ ++ "%2.2d:%2.2d:%2.2d.%6.6ld", /* time */ + + /* date */ + brokentime->tm_mday, +@@ -79,7 +79,7 @@ + brokentime->tm_hour, + brokentime->tm_min, + brokentime->tm_sec, +- tp->tv_usec ++ (long)tp->tv_usec + ); + break; + +diff -urN tcpick-0.2.1.org/src/tracker.c tcpick-0.2.1/src/tracker.c +--- tcpick-0.2.1.org/src/tracker.c 2004-12-31 14:53:30.000000000 +0100 ++++ tcpick-0.2.1/src/tracker.c 2014-01-12 13:42:03.844623406 +0100 +@@ -99,7 +99,12 @@ + if( curr->next == NULL ) + last_conn = prev_ring; + +- free_desc( &(curr->client) ); ++ free_desc( &(curr->client), 1 ); ++ if( flags.writer.type == UNIQUE ) { ++ free_desc( &(curr->server), 0 ); ++ } else { ++ free_desc( &(curr->client), 1 ); ++ } + free_desc( &(curr->server) ); + S_free( curr ); + +@@ -124,7 +129,7 @@ + count_opened--; + } + +-int free_desc( struct HOST_DESC * desc ) ++int free_desc( struct HOST_DESC * desc, int free_filename_too ) + /* frees the host descriptor and closes the file */ + { + struct FRAGMENT * tmp; +@@ -134,7 +139,7 @@ + if (flags.writer.type == UNIQUE) + desc->oth->file = NULL; + } +- if( desc->filename ) { ++ if( desc->filename && free_filename_too ) { + S_free( desc->filename ); + desc->filename = NULL; + } +diff -urN tcpick-0.2.1.org/src/write.c tcpick-0.2.1/src/write.c +--- tcpick-0.2.1.org/src/write.c 2005-01-09 00:54:47.000000000 +0100 ++++ tcpick-0.2.1/src/write.c 2014-01-12 13:30:17.171313500 +0100 +@@ -27,6 +27,8 @@ + + #include "tcpick.h" + #include "extern.h" ++#include "lookup.h" ++ + + __inline__ char * + avail_filename(struct CONN * conn_ptr, diff --git a/net-misc/tcpick/files/tcpick_0.2.1-shortpkts.patch b/net-misc/tcpick/files/tcpick_0.2.1-shortpkts.patch new file mode 100644 index 000000000..8ef0500c9 --- /dev/null +++ b/net-misc/tcpick/files/tcpick_0.2.1-shortpkts.patch @@ -0,0 +1,100 @@ +diff -ur tcpick-0.2.1.org/src/extern.h tcpick-0.2.1/src/extern.h +--- tcpick-0.2.1.org/src/extern.h 2005-01-13 16:34:01.000000000 +0100 ++++ tcpick-0.2.1/src/extern.h 2014-01-13 02:03:11.032836174 +0100 +@@ -10,6 +10,7 @@ + */ + + /* FIXME: it seems written by a ogre */ ++extern struct ether_header *etherpacket; + extern struct ip *ippacket; + extern struct tcphdr *tcppacket; + extern struct udphdr *udppacket; +diff -ur tcpick-0.2.1.org/src/globals.h tcpick-0.2.1/src/globals.h +--- tcpick-0.2.1.org/src/globals.h 2005-01-13 16:33:54.000000000 +0100 ++++ tcpick-0.2.1/src/globals.h 2014-01-13 02:07:09.356161517 +0100 +@@ -9,6 +9,7 @@ + * + */ + ++struct ether_header *etherpacket; + struct ip *ippacket; + struct tcphdr *tcppacket; + struct udphdr *udppacket; +diff -ur tcpick-0.2.1.org/src/loop.c tcpick-0.2.1/src/loop.c +--- tcpick-0.2.1.org/src/loop.c 2005-01-16 16:26:56.000000000 +0100 ++++ tcpick-0.2.1/src/loop.c 2014-01-14 01:20:31.796544631 +0100 +@@ -51,6 +51,18 @@ + + count_packets++; + ++ if (hdr->caplen != hdr->len) { ++ debug("packet#%d: %d != %d!!! Don't have complete packet. Skipping.", ++ count_packets, hdr->caplen, hdr->len); ++ goto end; ++ } ++ ++ etherpacket=(struct ether_header *) packet; ++ if (ntohs(etherpacket->ether_type) != ETHERTYPE_IP) { ++ debug("packet#%d: protocol is not IP. Skipping.", count_packets); ++ goto end; ++ } ++ + ippacket=(struct ip *)(packet + datalink_size); + + #if __BYTE_ORDER == __LITTLE_ENDIAN +@@ -69,9 +81,8 @@ + payload = (u_char *)(packet + datalink_size + IP_SIZE + tcp_size); + payload_len = iplen - IP_SIZE - tcp_size; + +-#ifdef TCPICK_DEBUG + if( payload_len != (hdr->len - (int)( payload - packet ) ) ) { +- suicide( "got_packet", ++ /*suicide( "got_packet", + "payload lenght calculated with iplen and hdr->len\n" + "differs by %d bytes\n" + "hdr->len = %d\n" +@@ -90,9 +101,19 @@ + payload_len, + (hdr->len - (int)( payload - packet )) + ); ++ */ ++ /* take as much as we have as payload :-( */ ++ if (datalink_size + IP_SIZE + tcp_size < hdr->len) { ++ payload_len = hdr->len - datalink_size - IP_SIZE - tcp_size; ++ debug("packet#%d: %d < %d!!! Don't have complete TCP packet.", ++ count_packets-1, hdr->len, datalink_size + iplen); ++ } else { ++ debug(stdout, "packet#%d: %d < %d!!! Don't have TCP payload. Skipping.", ++ count_packets-1, hdr->len, datalink_size + iplen); ++ goto end; ++ } + } + +-#endif /* TCPICK_DEBUG */ + + if( flags.header > 0 ) + display_header( stdout, ippacket, tcppacket, +@@ -103,6 +124,11 @@ + if( payload_len == 0 || SILENCE ) + goto end; + ++ if( payload_len < 0) { ++ debug("oops, got_packet bad payload length(TCP): %d", payload_len); ++ goto end; ++ } ++ + out_flavour( flags.display_payload, + stdout, payload, payload_len ); + +@@ -116,6 +142,11 @@ + if( payload_len == 0 || SILENCE ) + goto end; + ++ if( payload_len < 0) { ++ debug("oops, got_packet bad payload length(UDP): %d", payload_len); ++ goto end; ++ } ++ + out_flavour( flags.display_payload, + stdout, payload, payload_len ); + diff --git a/net-misc/tcpick/tcpick-0.2.1-r1.ebuild b/net-misc/tcpick/tcpick-0.2.1-r1.ebuild new file mode 100644 index 000000000..cabae2250 --- /dev/null +++ b/net-misc/tcpick/tcpick-0.2.1-r1.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="5" + +inherit eutils + +DESCRIPTION="A tcp stream sniffer, tracker and capturer." +HOMEPAGE="http://tcpick.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~amd64" +IUSE="" + +DEPEND="net-libs/libpcap" +RDEPEND="${DEPEND}" + +src_prepare() { + epatch "${FILESDIR}"/tcpick-0.2.1-CVE-2006-0048.patch + epatch "${FILESDIR}"/tcpick-0.2.1-ppc.patch + epatch "${FILESDIR}"/tcpick-0.2.1-cpu-loop.patch + epatch "${FILESDIR}"/tcpick-0.2.1-timezone.patch + epatch "${FILESDIR}"/tcpick-0.2.1-pointers.patch + + epatch "${FILESDIR}"/tcpick_0.2.1-shortpkts.patch +#issue https://code.google.com/p/pentoo/issues/detail?id=215 +# epatch "${FILESDIR}"/tcpick_0.2.1-amd.patch + +} + +src_install () { + dobin src/tcpick + dodoc EXAMPLES OPTIONS README +} diff --git a/profiles/pentoo/base/package.accept_keywords/net-misc b/profiles/pentoo/base/package.accept_keywords/net-misc index 4c2aed9ae..8ae36fa2e 100644 --- a/profiles/pentoo/base/package.accept_keywords/net-misc +++ b/profiles/pentoo/base/package.accept_keywords/net-misc @@ -78,7 +78,7 @@ net-misc/ssh-installkeys net-misc/strongswan net-misc/suite3270 net-misc/switzerland -net-misc/tcpick +~net-misc/tcpick-0.2.1 net-misc/termpkg net-misc/throttle net-misc/tinc