File ntop-4.0.3.diff of Package ntop
Index: Makefile.am
===================================================================
--- Makefile.am.orig
+++ Makefile.am
@@ -71,8 +71,7 @@ ETTER_PASSIVE = $(ETTER_PASSIVE_FILE).gz
ETTER_PASSIVE_DOWNLOAD_FROM = "http://ettercap.cvs.sourceforge.net/ettercap/ettercap_ng/share"
ETTER_PASSIVE_DOWNLOAD_PARMS = "rev=HEAD"
-NTOPDATA = ntop-cert.pem \
- $(ETTER_PASSIVE) \
+NTOPDATA = $(ETTER_PASSIVE) \
oui.txt.gz \
specialMAC.txt.gz \
GeoIPASNum.dat \
@@ -133,8 +132,7 @@ libntop_la_SOURCES = address.c argv.c
ntop.c pbuf.c database.c \
plugin.c prefs.c protocols.c \
sessions.c term.c util.c utildl.c \
- traffic.c vendor.c version.c \
- ntop_darwin.c
+ traffic.c vendor.c version.c
libntop_la_DEPENDENCIES = config.h
libntop_la_LIBADD = $(BASE_LIBS)
@@ -336,7 +334,7 @@ install: install-recursive
install-selinux-policy:
chcon -t textrel_shlib_t $(DESTDIR)$(libdir)/*ntop*.so
-install-data-local: ntop.txt ntop.html faq.html dnetter
+install-data-local: ntop.txt ntop.html faq.html
@$(top_srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)/plugins;
@if ! test -d $(DESTDIR)/$(datadir)/ntop; then \
$(top_srcdir)/mkinstalldirs $(DESTDIR)/$(datadir)/ntop; \
@@ -399,48 +397,6 @@ dnvt:
#dnsapt:
# @(cd Internet; wget -c http://www.iana.org/assignments/novell-sap-numbers)
-# download the passive ethernet fingerprint database
-dnetter:
- @echo ""
- @echo ""
- @echo "Preparing "
- @echo ""
-
- @if test -f $(ETTER_PASSIVE).old; then \
- echo "...Deleting prior file, $(ETTER_PASSIVE).old..."; \
- rm -rf $(ETTER_PASSIVE).old; \
- fi;
- @if test -f $(ETTER_PASSIVE); then \
- echo "...Moving current $(ETTER_PASSIVE) to $(ETTER_PASSIVE).old"; \
- mv $(ETTER_PASSIVE) $(ETTER_PASSIVE).old; \
- fi;
- @for file in $(ETTER_PASSIVE) $(ETTER_PASSIVE).gz \
- $(ETTER_PASSIVE_FILE) $(ETTER_PASSIVE_FILE).gz; do \
- if test -f $$file; then \
- echo "...Deleting prior file, $$file..."; \
- rm -rf $$file; \
- fi; \
- done
- @echo ""
- @echo "...Downloading new file..."
- @wget -O $(ETTER_PASSIVE_FILE) \
- $(ETTER_PASSIVE_DOWNLOAD_FROM)/$(ETTER_PASSIVE_FILE)?$(ETTER_PASSIVE_DOWNLOAD_PARMS)
- @echo ""
- @echo "gziping downloaded file..."
- @gzip $(ETTER_PASSIVE_FILE)
- @echo ""
- @echo ""
- @if test -f $(ETTER_PASSIVE).old; then \
- echo -n "Old file lines were: "; \
- gunzip -c $(ETTER_PASSIVE).old | wc -l; \
- fi;
- @echo -n "New file lines are: "
- @gunzip -c $(ETTER_PASSIVE) | wc -l
- @echo ""
- @echo ""
- @echo "New file is:"
- @ls -l $(ETTER_PASSIVE)
-
# ntop census
census-fail:
@echo "This option is no longer available... thanks for trying"
Index: fcUtils.c
===================================================================
--- fcUtils.c.orig
+++ fcUtils.c
@@ -660,6 +660,7 @@ void processFcNSCacheFile(char *filename
strncpy (&entry->alias[0], alias, MAX_LEN_SYM_HOST_NAME);
entry->alias[MAX_LEN_SYM_HOST_NAME-1] = '\0';
}
+ fclose(fd);
}
#endif /* ENABLE_FC */
Index: autogen.sh
===================================================================
--- autogen.sh.orig
+++ autogen.sh
@@ -202,16 +202,6 @@ AUTOCONF=`find_command 'autoconf*'`
GNU_OR_DIE=0
}
-WGET=`find_command 'wget*'`
-($WGET --version) < /dev/null > /dev/null 2>&1 ||
-{
- echo
- echo "You must have wget installed to compile $progname."
- echo "Download the appropriate package for your distribution, or get the"
- echo "source tarball from ftp://ftp.gnu.org/pub/gnu/wget"
- GNU_OR_DIE=0
-}
-
if test "$GNU_OR_DIE" -eq 0; then
exit 1
fi
Index: fcReport.c
===================================================================
--- fcReport.c.orig
+++ fcReport.c
@@ -4044,7 +4044,7 @@ void printFCSessions (int actualDeviceId
char buf[LEN_GENERAL_WORK_BUFFER], *sign;
char *arrowGif, *arrow[48], *theAnchor[48];
char htmlAnchor[64], htmlAnchor1[64];
- char vsanBuf[LEN_MEDIUM_WORK_BUFFER], formatBuf[7][32];
+ char vsanBuf[LEN_MEDIUM_WORK_BUFFER], formatBuf[15][32];
char hostLinkBuf[LEN_GENERAL_WORK_BUFFER],
hostLinkBuf1[LEN_GENERAL_WORK_BUFFER];
FCSession **tmpTable, *session;
Index: globals-core.h
===================================================================
--- globals-core.h.orig
+++ globals-core.h
@@ -269,10 +269,6 @@ extern void allocDeviceMemory(int device
#ifdef MAKE_WITH_SAFER_ROUTINES
-/* Fix to the free prototype courtesy of Tanner Lovelace <lovelace@opennms.org> */
-/* Fix free() courtesy of Benoit Dolez <bdolez@exosec.fr> */
-#define free(a) { void *__t = (a); ntop_safefree((void**)&(__t), (char*)__FILE__, (int)__LINE__); a = __t; }
-extern void ntop_safefree(void **ptr, char* file, int line);
#define malloc(sz) ntop_safemalloc((unsigned int)sz, (char*)__FILE__, (int)__LINE__)
extern void* ntop_safemalloc(unsigned int sz, char* file, int line);
#define calloc(c,sz) ntop_safecalloc(c, sz, (char*)__FILE__, (int)__LINE__)
Index: pbuf.c
===================================================================
--- pbuf.c.orig
+++ pbuf.c
@@ -3490,8 +3490,8 @@ void processPacket(u_char *_deviceId,
memcpy(&serverType, &ipxBuffer[32], 2);
serverType = ntohs(serverType);
- memcpy(serverName, &ipxBuffer[34], 56); serverName[56] = '\0';
- for(i=0; i<56; i++)
+ memcpy(serverName, &ipxBuffer[34], MAX_LEN_SYM_HOST_NAME); serverName[MAX_LEN_SYM_HOST_NAME-1] = '\0';
+ for(i=0; i<MAX_LEN_SYM_HOST_NAME; i++)
if(serverName[i] == '!') {
serverName[i] = '\0';
break;
@@ -3659,7 +3659,7 @@ void processPacket(u_char *_deviceId,
memcpy(nodeName, &p1[7+p1[5+displ]+displ], p1[6+p1[5+displ]+displ]);
nodeName[p1[6+p1[5+displ]]] = '\0';
- for(i=0; i<MAX_NODE_TYPES; i++)
+ for(i=0; i<MAX_NODE_TYPES-1; i++)
if((srcHost->nonIPTraffic->atNodeType[i] == NULL)
|| (strcmp(srcHost->nonIPTraffic->atNodeType[i], nodeName) == 0))
break;
Index: plugins/rrdPlugin.c
===================================================================
--- plugins/rrdPlugin.c.orig
+++ plugins/rrdPlugin.c
@@ -5127,7 +5127,7 @@ static void* rrdTrafficThreadLoop(void*
traceEvent(CONST_TRACE_INFO,
"THREADMGMT[t%lu]: RRD: Throughput data collection: Thread terminated [p%d]",
(long unsigned int)pthread_self(), getpid());
- return(NULL);
+ return;
}
/* ****************************** */