diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/ndsad/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/ndsad/files')
-rw-r--r-- | net-analyzer/ndsad/files/ndsad-1.33-conf_path.patch | 11 | ||||
-rw-r--r-- | net-analyzer/ndsad/files/ndsad-1.33-gentoo.patch | 23 | ||||
-rw-r--r-- | net-analyzer/ndsad/files/ndsad-1.33-getpid.patch | 10 | ||||
-rw-r--r-- | net-analyzer/ndsad/files/ndsad-1.33-log-path.patch | 11 | ||||
-rw-r--r-- | net-analyzer/ndsad/files/ndsad-1.33-strncpy-overflow.patch | 12 | ||||
-rw-r--r-- | net-analyzer/ndsad/files/ndsad.conf.d | 8 | ||||
-rw-r--r-- | net-analyzer/ndsad/files/ndsad.init | 32 |
7 files changed, 107 insertions, 0 deletions
diff --git a/net-analyzer/ndsad/files/ndsad-1.33-conf_path.patch b/net-analyzer/ndsad/files/ndsad-1.33-conf_path.patch new file mode 100644 index 000000000000..cf3c827cdde7 --- /dev/null +++ b/net-analyzer/ndsad/files/ndsad-1.33-conf_path.patch @@ -0,0 +1,11 @@ +--- a/ndsad.cc ++++ b/ndsad.cc +@@ -12,7 +12,7 @@ + */
+
+
+-#define conf_path "/netup/utm5/ndsad.cfg"
++#define conf_path "/etc/ndsad.conf"
+
+ #include "pcap.local.h"
+
diff --git a/net-analyzer/ndsad/files/ndsad-1.33-gentoo.patch b/net-analyzer/ndsad/files/ndsad-1.33-gentoo.patch new file mode 100644 index 000000000000..3ccbe3432932 --- /dev/null +++ b/net-analyzer/ndsad/files/ndsad-1.33-gentoo.patch @@ -0,0 +1,23 @@ +--- a/configure.in ++++ b/configure.in +@@ -24,9 +24,6 @@ + AC_DEFINE(OS_BSD, 2,[BSD OS code]) + AC_DEFINE(OS_SOLARIS, 3,[SOLARIS on SPARC code]) + +-CFLAGS=-g +-CXXFLAGS=-g +- + AC_CHECK_LIB(pcap, pcap_loop, [LIBS="$LIBS -lpcap"; __ac_have_libpcap=1;], [ break ]) + + case "$host_os" in +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,6 +1,6 @@ +-bin_PROGRAMS = ndsad ++sbin_PROGRAMS = ndsad + + ndsad_SOURCES = linux_ulog.cc linux_ulog.h debug.h eth-hndl.h handlers.h iflist.h iptonf.h ldefs.h logger.h mempool.h nethdr.h nfc.h nf.h ppp-hndl.h thr.h config.cc debug.cc eth-hndl.cc handlers.cc iflist.cc iptonf.cc logger.cc mempool.cc ndsad.cc nf.cc nfc.cc ppp-hndl.cc thr.cc bsd_divert.cc bsd_divert.h + +-ndsad_CXXFLAGS = $(AM_CXXFLAGS) -O0 -fno-inline -g -ftemplate-depth-32 ++ndsad_CXXFLAGS = $(AM_CXXFLAGS) -fno-inline -ftemplate-depth-32 + ndsad_LDFLAGS = $(AM_LDFLAGS) diff --git a/net-analyzer/ndsad/files/ndsad-1.33-getpid.patch b/net-analyzer/ndsad/files/ndsad-1.33-getpid.patch new file mode 100644 index 000000000000..c0e6d94a301c --- /dev/null +++ b/net-analyzer/ndsad/files/ndsad-1.33-getpid.patch @@ -0,0 +1,10 @@ +--- a/linux_ulog.h ++++ b/linux_ulog.h +@@ -8,6 +8,7 @@ + #include <pthread.h> + #include <iostream> + #include <sys/types.h> ++#include <unistd.h> /* getpid() */ + #include <sys/socket.h> + + /// linux specific headers! diff --git a/net-analyzer/ndsad/files/ndsad-1.33-log-path.patch b/net-analyzer/ndsad/files/ndsad-1.33-log-path.patch new file mode 100644 index 000000000000..fbeab07fb7a0 --- /dev/null +++ b/net-analyzer/ndsad/files/ndsad-1.33-log-path.patch @@ -0,0 +1,11 @@ +--- a/ndsad.conf ++++ b/ndsad.conf +@@ -75,7 +75,7 @@ + # Default: + #log (null) + # Example: +-log /tmp/ndsad.log ++log /var/log/ndsad.log + + # Jump to another configuration file + # Current file is closed after this line! Beware of loops! diff --git a/net-analyzer/ndsad/files/ndsad-1.33-strncpy-overflow.patch b/net-analyzer/ndsad/files/ndsad-1.33-strncpy-overflow.patch new file mode 100644 index 000000000000..5078f1555ec6 --- /dev/null +++ b/net-analyzer/ndsad/files/ndsad-1.33-strncpy-overflow.patch @@ -0,0 +1,12 @@ +--- a/handlers.h ++++ b/handlers.h +@@ -30,7 +30,8 @@ + #ifdef WIN32 + #define IFN_SIZE 512 // on windows iface names are VEERY long + #else +-#define IFN_SIZE 32 // iface name size. As in linux/sockios.h ++#include <net/if.h> ++#define IFN_SIZE IFNAMSIZ // iface name size. As in linux/sockios.h + #endif + + #define MPH_IFLIST 0x2 // iface type - for mempool diff --git a/net-analyzer/ndsad/files/ndsad.conf.d b/net-analyzer/ndsad/files/ndsad.conf.d new file mode 100644 index 000000000000..c216c39affec --- /dev/null +++ b/net-analyzer/ndsad/files/ndsad.conf.d @@ -0,0 +1,8 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# See config file /etc/ndsad.conf for configuration options. + +# If you want to add any extra command line options to be used by ndsad on +# start-up put them here. +NDSAD_OPTS="" diff --git a/net-analyzer/ndsad/files/ndsad.init b/net-analyzer/ndsad/files/ndsad.init new file mode 100644 index 000000000000..0ae33b5d98ac --- /dev/null +++ b/net-analyzer/ndsad/files/ndsad.init @@ -0,0 +1,32 @@ +#!/sbin/openrc-run +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +checkconfig() { + if [ ! -f /etc/ndsad.conf ] ; then + eerror "/etc/ndsad.conf does not file exists!" + return 1 + fi + + return 0 +} + +start() { + # Comment out the following line to get faster startups + checkconfig || return 1 + + ebegin "Starting ndsad" + # On success ndsad returns 1. + start-stop-daemon --start --quiet --exec /usr/sbin/ndsad -- -d ${NDSAD_OPTS} >/dev/null 2>&1 + eend $(( $? - 1 )) +} + +stop () { + ebegin "Stopping ndsad" + start-stop-daemon --stop --quiet --pidfile=/run/ndsad.pid --retry 20 >/dev/null + eend $? +} |