Install sancp-1.6.2-candidate.C

johncurry

New Member


Messages: 14

The compiler is having problems linking to the libprelude library, itself.


Let's find the location of libprelude.so.

Code:
find /usr | grep libprelude.so
/usr/local/lib/libprelude.so
then add it to the PRELUDE-CFLAGS= in the Makefile.

Code:
PRELUDE-CFLAGS=-I/usr/local/include -L/usr/local/lib/libprelude.so
-John
 
OP
OP
S

sonysun

Member

Reaction score: 1
Messages: 36

I suppose the end is near;

Here is the new error :
Code:
sancp.o(.text+0x21e): In function `sancp_alert_init(prelude_client*)':
/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:94: undefined reference to `prelude_client_get_analyzer'
sancp.o(.text+0x243):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:98: undefined reference to `idmef_analyzer_new_model'
sancp.o(.text+0x267):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:101: undefined reference to `prelude_string_set_ref_fast'
sancp.o(.text+0x278):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:103: undefined reference to `idmef_analyzer_new_class'
sancp.o(.text+0x29c):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:106: undefined reference to `prelude_string_set_ref_fast'
sancp.o(.text+0x2ad):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:108: undefined reference to `idmef_analyzer_new_manufacturer'
sancp.o(.text+0x2d5):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:111: undefined reference to `prelude_string_set_ref_fast'
sancp.o(.text+0x2e6):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:113: undefined reference to `idmef_analyzer_new_version'
sancp.o(.text+0x30e):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:116: undefined reference to `prelude_string_set_ref_fast'
sancp.o(.text+0x6bb): In function `main':
/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:276: undefined reference to `prelude_log_set_flags'
sancp.o(.text+0x6c7):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:283: undefined reference to `prelude_init'
sancp.o(.text+0x84d):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:387: undefined reference to `prelude_client_new'
sancp.o(.text+0x875):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:395: undefined reference to `prelude_client_start'
sancp.o(.text+0x892):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:402: undefined reference to `prelude_client_set_flags'
sancp.o(.text+0xcdc):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:397: undefined reference to `prelude_perror'
sancp.o(.text+0xcfd):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:285: undefined reference to `prelude_perror'
sancp.o(.text+0xd1e):/usr/local/etc/sancp-1.6.2-candidate.C/sancp.cc:389: undefined reference to `prelude_perror'
statefull_logging.o(.text+0x11a3): In function `add_idmef_object':
/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:231: undefined reference to `idmef_path_new'
statefull_logging.o(.text+0x11bd):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:235: undefined reference to `idmef_value_new_from_path'
statefull_logging.o(.text+0x11d7):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:241: undefined reference to `idmef_path_set'
statefull_logging.o(.text+0x11e4):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:243: undefined reference to `idmef_value_destroy'
statefull_logging.o(.text+0x11ef):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:244: undefined reference to `idmef_path_destroy'
statefull_logging.o(.text+0x15c6): In function `record_prelude(cnx*)':
/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:264: undefined reference to `idmef_message_new'
statefull_logging.o(.text+0x15e0):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:265: undefined reference to `idmef_message_new_alert'
statefull_logging.o(.text+0x15fe):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:272: undefined reference to `idmef_time_new_from_gettimeofday'
statefull_logging.o(.text+0x1618):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:274: undefined reference to `idmef_alert_set_detect_time'
statefull_logging.o(.text+0x1627):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:278: undefined reference to `idmef_time_new_from_gettimeofday'
statefull_logging.o(.text+0x1647):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:279: undefined reference to `idmef_alert_set_create_time'
statefull_logging.o(.text+0x1654):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:282: undefined reference to `prelude_client_get_analyzer'
statefull_logging.o(.text+0x165c):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:282: undefined reference to `idmef_analyzer_ref'
statefull_logging.o(.text+0x1673):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:282: undefined reference to `idmef_alert_set_analyzer'
statefull_logging.o(.text+0x17c4):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:424: undefined reference to `idmef_message_destroy'
statefull_logging.o(.text+0x17e1):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:269: undefined reference to `idmef_time_new_from_time'
statefull_logging.o(.text+0x17f7):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:278: undefined reference to `idmef_message_destroy'
statefull_logging.o(.text+0x1b3a):/usr/local/etc/sancp-1.6.2-candidate.C/statefull_logging.cc:423: undefined reference to `prelude_client_send_idmef'
gmake: *** [bsd] Error 1
Best Regards
 

johncurry

New Member


Messages: 14

Ok, lets try linking against 'libprelude.a' instead of 'libprelude.so'.

Code:
find / | grep libprelude.a
/lib/libprelude.a
So the Makefile would then appear like this:

Code:
PRELUDE-CFLAGS=-I/usr/local/include -L/lib/libprelude.a
 

johncurry

New Member


Messages: 14

Hmmm, I'm testing on FreeBSD Release 6.1 which appears to have both the .so and .a, however sancp also compiles without the extra '-L' flag that I suggested. I will setup a FreeBSD 8.0 system in hopes to reproduce the linking problem you are having. I didn't get specific instructions from you on how you actually installed the libprelude package. I can't claim to be a FreeBSD guru, so anything you can offer to help me to recreate your environment would be greatly appreciated. :)

-John
 

johncurry

New Member


Messages: 14

Here are the flags you need to use in the sancp Makefile to compile support for the FreeBSD 8.0 ports installation of libprelude.

Code:
PRELUDE-CFLAGS=-I/usr/local/include /usr/local/lib/libprelude.so
-John
 
OP
OP
S

sonysun

Member

Reaction score: 1
Messages: 36

Hello,

I suppose we have an error when sancp try tro create a profile :

Code:
sonde:/etc/sancp# ./sancp -i eth0
sancp: Retrieved last connection ID: 0 8 2
sancp: Error reading: EINVAL
sancp: Opening without filter
19 Jul 16:27:15 (process:4213) CRITICAL: assertion 'profile' failed (prelude-client.c:1248 prelude_client_new)
19 Jul 16:27:15 (process:4213) WARNING: prelude-client: Unable to create a prelude client object: Critical assertion occurred.
sancp: Exiting
 
Top