Package: sniffit
Version: 0.3.7.beta-13
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu karmic ubuntu-patch
Hi,
In http://launchpad.net/bugs/107180 it was reported that sniffit would
crash sometimes. It was found to be because it missed some #include statements,
and so was compiled with the wrong prototypes for some functions.
Karoly Segesdi provided the attached patch to fix this. Please consider
applying it.
Thanks,
James
diff -u sniffit-0.3.7.beta/sniffit.0.3.7.c sniffit-0.3.7.beta/sniffit.0.3.7.c
--- sniffit-0.3.7.beta/sniffit.0.3.7.c
+++ sniffit-0.3.7.beta/sniffit.0.3.7.c
@@ -5,7 +5,9 @@
#include <unistd.h>
#include <signal.h>
+#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <fcntl.h>
/* #include <netdb.h> */
#include <errno.h>
diff -u sniffit-0.3.7.beta/sn_interface.c sniffit-0.3.7.beta/sn_interface.c
--- sniffit-0.3.7.beta/sn_interface.c
+++ sniffit-0.3.7.beta/sn_interface.c
@@ -6,7 +6,9 @@
#ifdef INCLUDE_INTERFACE
#include <signal.h>
#include <termios.h>
+#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include "sn_curses.h"
diff -u sniffit-0.3.7.beta/sn_logfile.c sniffit-0.3.7.beta/sn_logfile.c
--- sniffit-0.3.7.beta/sn_logfile.c
+++ sniffit-0.3.7.beta/sn_logfile.c
@@ -3,7 +3,9 @@
#include "sn_config.h"
+#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
#include "sn_defines.h"
diff -u sniffit-0.3.7.beta/Makefile.in sniffit-0.3.7.beta/Makefile.in
--- sniffit-0.3.7.beta/Makefile.in
+++ sniffit-0.3.7.beta/Makefile.in
@@ -10,9 +10,9 @@
LIBS = @LIBS@
DEFS = @DEFS@
OS_OPT = @OS_OPT@
-OBJ_FLAG = -w -O2 -c
+OBJ_FLAG = -O2 -c
OBJ_OPT = -I./libpcap -L./libpcap
-EXE_FLAG = -w -O2 -o sniffit
+EXE_FLAG = -O2 -o sniffit
EXE_OPT = -I./libpcap -L./libpcap -lpcap
EXE_OBJ = sn_packets.o sn_generation.o sn_interface.o sn_cfgfile.o \
sn_logfile.o sn_resolv.o
diff -u sniffit-0.3.7.beta/debian/changelog sniffit-0.3.7.beta/debian/changelog
only in patch2:
unchanged:
--- sniffit-0.3.7.beta.orig/sn_cfgfile.c
+++ sniffit-0.3.7.beta/sn_cfgfile.c
@@ -2,7 +2,9 @@
/* - by : Brecht Claerhout */
/* - improvements: Shudoh Kazuyuki */
+#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <netdb.h> /* for getservbyname() */
#include "sn_config.h"
@@ -10,6 +12,7 @@
#include "sn_structs.h"
#include "sn_cfgfile.h"
#include "sn_resolv.h"
+#include "sniffit.h"
/* #include "sn_generation.h" */
extern struct cfg_file_contense *select_from_list; /* pointers for cfg lists */
only in patch2:
unchanged:
--- sniffit-0.3.7.beta.orig/sn_generation.c
+++ sniffit-0.3.7.beta/sn_generation.c
@@ -5,7 +5,9 @@
#include "sn_config.h"
#ifdef INCLUDE_INTERFACE
#ifdef GENERATION
+#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "sn_curses.h"
only in patch2:
unchanged:
--- sniffit-0.3.7.beta.orig/sn_packets.c
+++ sniffit-0.3.7.beta/sn_packets.c
@@ -4,6 +4,7 @@
#include "sn_config.h"
#include "sn_defines.h"
#include "sn_structs.h"
+#include <string.h>
#include <netinet/in.h>
extern int PROTO_HEAD;
only in patch2:
unchanged:
--- sniffit-0.3.7.beta.orig/sniffit.h
+++ sniffit-0.3.7.beta/sniffit.h
@@ -3,6 +3,8 @@
#ifndef _SNIFFIT_H_
#define _SNIFFIT_H_
+#include "pcap.h"
+
/**** Sniffit functions *****************************************************/
int check_packet(_32_bit,
const struct packetheader *,