snort: upgrade 2.9.11.1 -> 2.9.13

* Add PACKAGECONFIG[appid] for application identification support.

* Set the variables 'have_daq_packet_trace' and
  'have_daq_verdict_reason' to 'no' since they are only supported in daq
  2.2.2 but not in 2.0.6.

* Cleanup snort.init script and fix the incorrect argument of mkdir

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Yi Zhao 2019-06-19 13:50:03 +08:00 committed by Khem Raj
parent c3b19334d7
commit 3e03fe9984
3 changed files with 32 additions and 30 deletions

View File

@ -226,7 +226,7 @@ index 4b3a5db..a6c5498 100644
-]])], -]])],
-[have_daq_packet_trace="yes"], -[have_daq_packet_trace="yes"],
-[have_daq_packet_trace="no"]) -[have_daq_packet_trace="no"])
+have_daq_packet_trace="yes" +have_daq_packet_trace="no"
AC_MSG_RESULT($have_daq_packet_trace) AC_MSG_RESULT($have_daq_packet_trace)
if test "x$have_daq_packet_trace" = "xyes"; then if test "x$have_daq_packet_trace" = "xyes"; then
AC_DEFINE([HAVE_DAQ_PKT_TRACE],[1], AC_DEFINE([HAVE_DAQ_PKT_TRACE],[1],
@ -245,7 +245,7 @@ index 4b3a5db..a6c5498 100644
-]])], -]])],
-[have_daq_verdict_reason="yes"], -[have_daq_verdict_reason="yes"],
-[have_daq_verdict_reason="no"]) -[have_daq_verdict_reason="no"])
+have_daq_verdict_reason="yes" +have_daq_verdict_reason="no"
AC_MSG_RESULT($have_daq_verdict_reason) AC_MSG_RESULT($have_daq_verdict_reason)
if test "x$have_daq_verdict_reason" = "xyes"; then if test "x$have_daq_verdict_reason" = "xyes"; then
AC_DEFINE([HAVE_DAQ_VERDICT_REASON],[1], AC_DEFINE([HAVE_DAQ_VERDICT_REASON],[1],

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Snort Startup Script modified for OpenEmbedded # Snort Startup Script modified for OpenEmbedded
# #
# Script variables # Script variables
@ -30,16 +30,16 @@ fi
start() start()
{ {
[ -n "$LAN_INTERFACE" ] || return 0 [ -n "$LAN_INTERFACE" ] || return 0
# Check if log diratory is present. Otherwise, create it. # Check if log diratory is present. Otherwise, create it.
if [ ! -d $LOGDIR/$DATE ]; then if [ ! -d $LOGDIR/$DATE ]; then
mkdir -d $LOGDIR/$DATE mkdir -p $LOGDIR/$DATE
/bin/chown -R $USER:$USER $LOGDIR/$DATE /bin/chown -R $USER:$USER $LOGDIR/$DATE
/bin/chmod -R 700 $LOGDIR/$DATE /bin/chmod -R 700 $LOGDIR/$DATE
fi fi
/bin/echo "Starting $PROG: " /bin/echo "Starting $PROG: "
# Snort parameters # Snort parameters
# -D Run Snort in background (daemon) mode # -D Run Snort in background (daemon) mode
# -i <if> Listen on interface <if> # -i <if> Listen on interface <if>
@ -64,7 +64,7 @@ stop()
RETURN_VAL=$? RETURN_VAL=$?
/bin/echo "$PROG shutdown complete." /bin/echo "$PROG shutdown complete."
[ -e $DEL_PID ] && rm -f $DEL_PID [ -e $DEL_PID ] && rm -f $DEL_PID
[ -e $DEL_PID.lck ] && rm -f $DEL_PID.lck [ -e $DEL_PID.lck ] && rm -f $DEL_PID.lck
else else
/bin/echo "ERROR: PID in $PID file not found." /bin/echo "ERROR: PID in $PID file not found."
RETURN_VAL=1 RETURN_VAL=1
@ -72,12 +72,13 @@ stop()
return $RETURN_VAL return $RETURN_VAL
} }
status() { status()
if [ -s $PID ]; then {
echo "$PROG is running as pid `cat $PID`:" if [ -s $PID ]; then
else echo "$PROG is running as pid `cat $PID`:"
echo "$PROG is not running." else
fi echo "$PROG is not running."
fi
} }
restart() restart()
@ -89,21 +90,21 @@ restart()
} }
case "$1" in case "$1" in
start) start)
start start
;; ;;
stop) stop)
stop stop
;; ;;
status) status)
status status
;; ;;
restart|reload) restart|reload)
restart restart
;; ;;
*) *)
/bin/echo "Usage: $0 {start|stop|status|restart|reload}" /bin/echo "Usage: $0 {start|stop|status|restart|reload}"
RETURN_VAL=1 RETURN_VAL=1
esac esac
exit $RETURN_VAL exit $RETURN_VAL

View File

@ -13,8 +13,8 @@ SRC_URI = "https://www.snort.org/downloads/archive/snort/${BP}.tar.gz \
file://disable-run-test-program-while-cross-compiling.patch \ file://disable-run-test-program-while-cross-compiling.patch \
" "
SRC_URI[md5sum] = "378e3938b2b5c8e358f942d0ffce18cc" SRC_URI[md5sum] = "b61ae846af022018b05511076baad60c"
SRC_URI[sha256sum] = "9f6b3aeac5a109f55504bd370564ac431cb1773507929dc461626898f33f46cd" SRC_URI[sha256sum] = "31447393d15286b848810dd78ab2cb3ad231fcd1f1663f959587690eeea75413"
UPSTREAM_CHECK_URI = "https://www.snort.org/downloads" UPSTREAM_CHECK_URI = "https://www.snort.org/downloads"
UPSTREAM_CHECK_REGEX = "snort-(?P<pver>\d+(\.\d+)+)\.tar" UPSTREAM_CHECK_REGEX = "snort-(?P<pver>\d+(\.\d+)+)\.tar"
@ -45,6 +45,7 @@ EXTRA_OECONF = " \
PACKAGECONFIG ?= "openssl lzma" PACKAGECONFIG ?= "openssl lzma"
PACKAGECONFIG[openssl] = "--with-openssl-includes=${STAGING_INCDIR} --with-openssl-libraries=${STAGING_LIBDIR}, --without-openssl-includes --without-openssl-libraries, openssl," PACKAGECONFIG[openssl] = "--with-openssl-includes=${STAGING_INCDIR} --with-openssl-libraries=${STAGING_LIBDIR}, --without-openssl-includes --without-openssl-libraries, openssl,"
PACKAGECONFIG[lzma] = "--with-lzma-includes=${STAGING_INCDIR} --with-lzma-libraries=${STAGING_LIBDIR}, --without-lzma-includes --without-lzma-libraries, xz," PACKAGECONFIG[lzma] = "--with-lzma-includes=${STAGING_INCDIR} --with-lzma-libraries=${STAGING_LIBDIR}, --without-lzma-includes --without-lzma-libraries, xz,"
PACKAGECONFIG[appid] = "--enable-open-appid, --disable-open-appid, luajit, bash"
CFLAGS += "-I${STAGING_INCDIR}/tirpc" CFLAGS += "-I${STAGING_INCDIR}/tirpc"
LDFLAGS += " -ltirpc" LDFLAGS += " -ltirpc"