Snort mailing list archives

Re: A few Issues Building Snort++ (3.0.0-a4-b244) on Ubuntu


From: Noah Dietrich <noah_dietrich () 86penny org>
Date: Mon, 19 Mar 2018 19:47:50 +0200

Thank you Russ and YM for your help

//------------------------------------------------------------------
1. SafeC issues:
I see the same results as YM, snort says during the install that safec
isn't avaliable, but ldd shows it included:

./configure_cmake.sh --prefix=/opt/snort
(...)
Feature options:
    Flatbuffers:    ON
    Hyperscan:      ON
    ICONV:          ON
    LZMA:           ON
    *SafeC:          OFF*
    UUID:           ON
(...)

noah@snort16x64:~/snort_src/snort3/build$ *ldd /opt/snort/bin/snort | grep
safe*
libsafec-1.0.so.1 => /usr/local/lib/libsafec-1.0.so.1 (0x00007f2e8d58b000)

I manually set the PKG_CONFIG_PATH before the ./configure_cmake.sh step
with no change in the results, neither of the below made any difference:
export PKG_CONFIG_PATH=/usr/local/include/libsafec/
export PKG_CONFIG_PATH=/usr/local/include/

This looks to be a minor bug, especially if SafeC support is actually
enabled.

//----------------------------------------------------------------------
2. Snort Extras throwing error on 'make' issue
this seems to work when using --prefix=/opt/snort, but not when using
--prefix=/

export PKG_CONFIG_PATH=/opt/snort/lib/pkgconfig/
./configure_cmake.sh --prefix=/opt/snort

noah@snort16x64:~/snort_src/snort3/extra/build$ ls -l
/opt/snort/lib/pkgconfig/
total 4
-rw-r--r-- 1 root root 776 Mar 19 18:58 snort.pc


however, this is still an issue if you use --prefix=/ (see point 4 below)

//---------------------------------------------------------------------------------
3. Additional question -> will DAQ go to cmake in the future?

just curious.

//---------------------------------------------------------------------------------
4.  installation of snort binary when prefix = /

I've verified that when you set the prefix to the root of the system, it
installs everying under /usr
The commands i ran:
cd ~/snort_src
git clone git://github.com/snortadmin/snort3.git
cd ~/snort_src/snort3
./configure_cmake.sh --prefix=/
cd build
make
sudo make install

some output from sudo make install (everything shouldn't be going to /usr
here, unless i misunderstand how things work):
install the project...
-- Install configuration: ""
-- Installing: /usr/lib/pkgconfig/snort.pc
-- Installing: /usr/bin/snort
-- Installing: /usr/include/snort/actions/actions.h
-- Installing: /usr/include/snort/codecs/codec_module.h
-- Installing: /usr/include/snort/detection/detect.h
-- Installing: /usr/include/snort/detection/detection_engine.h


additionally, back to issue #2, when trying to install snort-extras using
--prefix=/, and pointing PKG_CONFIG_to the location where snort.pc is
installed, i get the same error:

cd extra/
export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
./configure_cmake.sh --prefix=/
cd build
make

noah@snort16x64:~/snort_src/snort3/extra/build$ make
Scanning dependencies of target cd_eapol
[  1%] Building CXX object
src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/cd_eapol.cc.o
/home/noah/snort_src/snort3/extra/src/codecs/cd_eapol/cd_eapol.cc:20:33:
fatal error: codecs/codec_module.h: No such file or directory
compilation terminated.
src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/build.make:62: recipe for
target 'src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/cd_eapol.cc.o' failed
make[2]: *** [src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/cd_eapol.cc.o]
Error 1
CMakeFiles/Makefile2:169: recipe for target
'src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/all' failed
make[1]: *** [src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

I also tried using --prefix-/usr, since that's where everything was
installed, but still recieved the above error.

All testing for the above errors was on Ubuntu 16 x64

Thank you,
Noah


On Sat, Mar 17, 2018 at 5:52 PM, Y M via Snort-devel <
snort-devel () lists snort org> wrote:

Resending to the list.

Additional comments...

- SafeC, in my case on a CentOS 7, is also OFF. However, ldd against Snort
binary shows that it references the libsafec library.

#ldd bin/snort
...
 libsafec-1.0.so.1 => /lib64/libsafec-1.0.so.1 (0x00007fa2971a9000)

- For Snort extras, I can confirm that lib64/pkgconfig is the correct path.

Thanks.
YM

------------------------------
*From:* Snort-devel <snort-devel-bounces () lists snort org> on behalf of
Russ via Snort-devel <snort-devel () lists snort org>
*Sent:* Saturday, March 17, 2018 5:55:34 PM
*To:* snort-devel () lists snort org
*Subject:* Re: [Snort-devel] A few Issues Building Snort++
(3.0.0-a4-b244) on Ubuntu

Thanks Noah.  Some comments below.

Russ

On 3/17/18 2:04 AM, Noah Dietrich wrote:

Hello,

I have found a few issues building Snort3 a4 b244 on Ubuntu.  Details
below:
1. Snort not able to detect SafeC libraries properly.

2. Trying to compile snort extras with configure_cmake.sh generates error
3. Additional question -> will DAQ go to cmake in the future?
4. Install location of snort binary seems off


//-----------------------------------------------------------------------
1. snort not able to detect SafeC libraries properly.

I am following the same build steps as with previous releases of Snort,
but now it doesn't detect the SafeC libraries. I have verified this issue
on Ubuntu 12 x86 and Ubuntu 14 x64:

./configure_cmake.sh --prefix=/
(...)
Feature options:
    Flatbuffers:    ON
    Hyperscan:      ON
    ICONV:          ON
    LZMA:           ON
    *SafeC:          OFF*
    UUID:           ON


I tried manually setting the path for the SafeC includes using cmake
directly but get the same results:

/usr/local/bin/cmake -DCMAKE_INSTALL_PREFIX=/ -DSAFEC_INCLUDE_DIR=/usr/local/include/libsafec
../snort3


SafeC libraries are installed to  /usr/local/include/libsafec:
noah@snort16x64:~/snort_src/snort3$ ls -l /usr/local/include/libsafec
total 24
-rw-r--r-- 1 root root 2790 Mar 17 06:20 safe_lib_errno.h
-rw-r--r-- 1 root root 2320 Mar 17 06:20 safe_lib.h
-rw-r--r-- 1 root root 3753 Mar 17 06:20 safe_mem_lib.h
-rw-r--r-- 1 root root 6417 Mar 17 06:20 safe_str_lib.h
-rw-r--r-- 1 root root 1917 Mar 17 06:20 safe_types.h
The snort3 configure_cmake.sh doesn't seem to allow for any configuration
of SafeC beyond disabling it.

Works on other systems, eg. Centos 7.  Do you have the safec-1.0.pc in
your PKG_CONFIG_PATH?



//-----------------------------------------------------------------------
------------------------------
2. Trying to compile snort extras with configure_cmake.sh generates error

I am tyring to configure snort extras using configure_cmake.sh, but as
soon as I navigate to the build directory and run 'make' I get an error.
Tested on Ubuntu 16 x64:

noah@snort16x64:~/snort_src/snort3$ ./configure_cmake.sh --prefix=/

(...)
-- Build files have been written to: /home/noah/snort_src/snort3/
extra/build
noah@snort16x64:~/snort_src/snort3/extra$ cd build
noah@snort16x64:~/snort_src/snort3/extra/build$ make
Scanning dependencies of target cd_eapol
[  1%] Building CXX object src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/cd_
eapol.cc.o
/home/noah/snort_src/snort3/extra/src/codecs/cd_eapol/cd_eapol.cc:20:33:
fatal error: codecs/codec_module.h: No such file or directory
compilation terminated.
src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/build.make:62: recipe for
target 'src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/cd_eapol.cc.o' failed
make[2]: *** [src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/cd_eapol.cc.o]
Error 1
CMakeFiles/Makefile2:169: recipe for target 'src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/all'
failed
make[1]: *** [src/codecs/cd_eapol/CMakeFiles/cd_eapol.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2


When installing in previous versions, I had to specify the PKG_CONFIG_PATH
before the compilation worked, but i'm not sure if that's required or
handled by your script automagically:
export PKG_CONFIG_PATH=/lib/pkgconfig/

This is required but you may need to use /lib64/pkgconfig/ now.



//-----------------------------------------------------------------------
----------
3. Additional question -> will DAQ go to cmake in the future?

Will DAQ move to cmake in the future?

There is no plan at this time to change DAQ to cmake.  Are you just
curious or is there a specific concern?


//-------------------------------------------------------------
4. Install location of snort binary seems off

When I run configure_cmake.sh and specify the prefix path as the root of
the drive (--prefix=/), most of the files are installed where you'd expect
(/etc/snort, et cetera), however the snort binary is placed in
/usr/bin/snort, this is different than previous installations, where
setting the prefix to the root of the drive would install the snort binary
to the /bin directory. is this a bug or by design?

Install should be using your prefix.  Maybe this broke with the recent use
of GNUInstallDirs.  However, we build and test using prefix all the time
and it is working here, but we probably never tried /.  I wouldn't expect
it to matter, but what happens if you use some other path?



thank you,
Noah




_______________________________________________
Snort-devel mailing listSnort-devel@lists.snort.orghttps://lists.snort.org/mailman/listinfo/snort-devel

Please visit http://blog.snort.org for the latest news about Snort!



_______________________________________________
Snort-devel mailing list
Snort-devel () lists snort org
https://lists.snort.org/mailman/listinfo/snort-devel

Please visit http://blog.snort.org for the latest news about Snort!


_______________________________________________
Snort-devel mailing list
Snort-devel () lists snort org
https://lists.snort.org/mailman/listinfo/snort-devel

Please visit http://blog.snort.org for the latest news about Snort!

Current thread: