components/snort/patches/snort.c.patch
author Rich Burridge <rich.burridge@oracle.com>
Fri, 14 Jun 2013 16:37:38 -0700
changeset 1345 ee87318d9935
child 2198 168b8acace5f
permissions -rw-r--r--
PSARC 2013/113 snort 2.9.2 15793348 SUNBT7170824 Update snort to version 2.9.2

Provide the directory where snort will initially look for DAQ modules.

This patch has not been sent upstream, because the Solaris integration
of libdaq is different from the way that Linux systems do this.

On Linux systems, DAQ installs two static libraries:

  /usr/lib/libdaq_static.a
  /usr/lib/libdaq_static_modules.a 

When snort is being configured, you see:

...
checking for daq_load_modules in -ldaq_static... yes
...

and at link time we see "-ldaq_static ... -ldaq_static_modules ...".

This means that when you start snort running, it knows where to
look for a set of DAQ modules that it loads. This is done with
with a call to the DAQ routine daq_load_modules().

On Solaris, we do not provide those two static libraries (or their 64-bit
equivalents). Therefore, by default, a call to daq_load_modules() using
the dynamic libraries doesn't know where to look for any DAQ modules.

Now you can override this by starting snort with:

  $ sudo /usr/bin/snort --daq-dir /usr/lib/64/daq

  or

  $ sudo /usr/bin/snort -c /etc/snort.conf

or something similar, but that doesn't allow:

  $ sudo /usr/bin/snort

to work, right out of the box, which is what snort users would expect.

To resolve this, at snort initialization time on Solaris, the code has
been adjusted to specify a single default DAQ module directory:

  /usr/lib/64/daq


--- snort-2.9.2/src/snort.c.orig	2013-05-15 11:52:06.640833897 -0700
+++ snort-2.9.2/src/snort.c	2013-05-15 11:58:03.040482526 -0700
@@ -3677,6 +3677,9 @@
 {
     SnortConfig *sc = (SnortConfig *)SnortAlloc(sizeof(SnortConfig));
 
+    /* Define where to look for DAQ modules. */
+    ConfigDaqDir(sc, "/usr/lib/64/daq");
+
     sc->pkt_cnt = -1;
     sc->pkt_snaplen = -1;
     /*user_id and group_id should be initialized to -1 by default, because