2005-05-18 Sebastien Tricaud <toady@gscore.org> * plugins/format/classic/classic.c: upgrade to version 14.2 * plugins/formats/classic/mysql.sql: added file_type for Prelude_File + upgrade to version 14.2 * plugins/formats/classic/pgsql.sql: added missing fields from mysql.sql * plugins/formats/classic/mysql-update-14-2.sql: * plugins/formats/classic/pgsql-update-14-2.sql: added, special thanks to Jerome Marrec and Guillaume Lelarge 2004-02-12 Yoann Vandoorselaere <yoann@prelude-ids.org> * configure.in: correct test for python/perl. 2004-02-06 Yoann Vandoorselaere <yoann@prelude-ids.org> * plugins/format/classic/idmef-db-insert.c (insert_additional_data): use the size returned by idmef_additionaldata_data_to_string(). 2004-02-03 Yoann Vandoorselaere <yoann@prelude-ids.org> * plugins/sql/pgsql/pgsql.c (db_build_time_constraint): * plugins/sql/mysql/mysql.c (db_build_time_constraint): remove call to prelude_get_gmt_offset(). gmt_offset is already provided as an argument, and so it make no sense to compute it again. Fix re-declaration of gmt_offset. * src/sql.c (build_time_constraint, build_criterion_hour): update call to prelude_get_gmt_offset() to fit API change. * plugins/format/classic/idmef-db-insert.c (insert_additional_data): back to using idmef_additionaldata_data_to_string(), which should now work better. 2004-02-01 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/python/preludedb.py: (PreludeDB.get_values) bug fixes: wrong test for tmp, and destroy function call of the wrong variable 2004-01-31 Yoann Vandoorselaere <yoann@prelude-ids.org> * plugins/format/classic/idmef-db-insert.c (insert_additional_data): remove call to idmef_additionaldata_data_to_string(). This function does absolutly nothing useful, and it's removal is pending. Use prelude_sql_escape_fast(). 2004-01-30 Yoann Vandoorselaere <yoann@prelude-ids.org> * plugins/sql/mysql/mysql.c (db_escape): s/string/buf/ 2004-01-30 Nicolas Delon <delon.nicolas@wanadoo.fr> * src/sql.c: (build_criterion_timestamp) bug fix, handle the "<=" relation correctly 2004-01-28 Yoann Vandoorselaere <yoann@prelude-ids.org> * src/sql.c (prelude_sql_escape_fast): implement. Same as prelude_sql_escape() but take a size as argument. * plugins/sql/pgsql/pgsql.c (db_escape): * plugins/sql/mysql/mysql.c (db_escape): now take a len argument. We doesn't compute len by ourself anymore. 2004-01-25 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.c: regenerated * bindings/python/_preludedb.c: regenerated * bindings/python/preludedb.py: add support for prelude_db_interface_get_*_ident_list_len * src/db-interface.c: * src/include/db-interface.h: * src/include/plugin-format.h: * plugins/format/classic/classic.c: add the ability to get the len of a db message ident list * plugins/format/classic/classic.c: (classic_get_values) bug fix, convert from UTC to localtime the time fields retrieved * plugins/format/classic/idmef-db-select.c: * src/sql.c: * src/include/sql.h: * src/include/plugin-sql.h * plugins/sql/mysql/mysql.c: * plugins/sql/pgsql/pgsql.c: add support for idmef-criterion-value 2004-01-14 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/pgsql.sql: bug fix, switch all time field in TIMESTAMP type (instead of VARCHAR or DATE types) * plugins/sql/pgsql/pgsql.c: (db_field_fetch) (db_field_fetch_by_name) bug fix, return NULL if the field contains NULL 2004-01-14 Yoann Vandoorselaere <yoann@prelude-ids.org> * plugins/sql/pgsql/pgsql.c (db_escape): checking the wrong variable is bad for your health. 2004-01-11 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/python/preludedb.py: (PreludeDB.__get_message) bug fix, return None if the underlying C function returns NULL * plugins/format/classic/idmef-db-get.c: (get_userid) bug fix, did not check correctly the return value of a get_uint32 (get_user) (get_process) bug fix, forgot to set table to NULL after destroying it that could lead to a double free (get_alert) (get_heartbeat) check if the alert/heartbeat is present in the DB before trying to fetch it instead of returning an empty idmef_message if it is not present 2004-01-10 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: (get_message_ident_list) bug fix for criteria argument retrieval 2004-01-07 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/classic.c: (get_message) fit idmef_message changes 2004-01-02 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-get.c: (get_timestamp) use idmef_time_set_db_timestamp (*) handle correctly NULL value: don't create empty object for NULL value anymore cleanup 2004-01-01 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-insert.c: (insert_inode) (insert_file) bug fix: insertion failed if there was no *time fields fit idmef_time_get_db_timestamp changes (insert_additional_data) bug fix: insertion failed if the len of the data embedded in additional_data was superior to 1024 bytes fit idmef_additionaldata_data_to_string changes (insert_createtime) (insert_detecttime) (insert_analyzertime) fit idmef_time_get_db_timestamp changes Happy new year to our ChangeLog readers ! ;) 2003-12-31 Yoann Vandoorselaere <yoann@prelude-ids.org> * plugins/sql/pgsql/pgsql.c (db_escape): fix uninitialized... 2003-12-31 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/classic.c: fix some warnings * plugins/format/classic/idmef-db-get.c: (get_ntp_timestamp) remove unused variables * plugins/sql/pgsql/pgsql.c: bug fix: db_limit_offset was assigned to the escape func entry of the plugin * src/param-string.c: fix some warnings 2003-12-29 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-get.c: (get_ntp_timestamp) bug fix: avoid (possibly buggy) code duplication, use idmef_time_new_ntp_timestamp to convert ntp stamptime to idmef_time * plugins/format/classic/idmef-db-select.c: * plugins/sql/mysql/mysql.c: * plugins/sql/pgsql/pgsql.c: * src/sql.c: * src/include/plugin-sql.h: * src/include/sql.h: make sql limit and offset the sql plugin' job to have a better portability (libpreludedb should re-work with MySQL 3.2x) 2003-12-29 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: (PreludeDBSQL) remove the "close" method (it should not be directly accessed) * bindings/python/preludedb.py: documentation written remove the "close" method (see above) cleanup 2003-12-28 Nicolas Delon <delon.nicolas@wanado.fr> * plugins/format/classic/idmef-db-insert.c: insert an empty string ("") if a MUST-BE-PRESENT string does not contain anything 2003-12-28 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-select.c: (relation_to_sql) fit last changes of prelude_sql_escape (and underlying db_escape sql plugin functions): the value is already quoted cleanup 2003-12-27 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/python/preludedb.py: fixes 2003-12-27 Yoann Vandoorselaere <yoann@prelude-ids.org> * src/include/Makefile.am (noinst_HEADERS): * src/Makefile.am (libpreludedb_la_SOURCES): * src/include/gdb.h: * src/gdb.c: removed. * plugins/sql/mysql/mysql.c (cleanup): * plugins/sql/pgsql/pgsql.c (cleanup): fix possible NULL pointer dereference on cleanup. * plugins/sql/mysql/mysql.c (db_escape): * plugins/sql/pgsql/pgsql.c (db_escape): updated. Return "NULL" if input is NULL. Else, quote the string using '' characters. Please note that this plugin is seriously updated compared to 0-8 version and that it should be synced asap. * plugins/format/classic/idmef-db-insert.c (insert_address): (insert_node): (insert_userid): (insert_user): (insert_process): (insert_snmp_service): (insert_service): (insert_inode): (insert_linkage): (insert_analyzer): (insert_target): (insert_source): (insert_file): (insert_classification): (insert_additional_data): (insert_createtime): (insert_detecttime): (insert_impact): (insert_analyzertime): (insert_action): (insert_confidence): (insert_overflow_alert): (insert_tool_alert): (insert_correlation_alert): Restore fix already applied to 0-8 branch, where the responssability to quote (' ') a string is up to the database plugin. This avoid insertion of quoted NULL entry in the database, which would be considered as valid string. * src/include/Makefile.am (include_HEADERS): * src/Makefile.am (libpreludedb_la_SOURCES): remove strbuf.[ch]. * plugins/format/classic/idmef-db-select.c: use prelude-strbuf instead of libpreludedb own strbuf implementation. 2003-12-26 Nicolas Delon <delon.nicolas@wanadoo.fr> * configure.in: don't regenerate the .c source files of bindings during ./configure * plugins/format/classic/db-object.c: * src/db.c: only print debug message if in debug mode 2003-12-26 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.c: regenerated * bindings/perl/PreludeDB.pm: cleanup (PreludeDBSelection) modified to use the new prelude_db_selected_object_new_string function (the function has been rewritten from Perl to C so that it can be also used from Python) * bindings/perl/PreludeDB.i: moved in bindings/libpreludedb.i * src/db-connection.c: * src/include/db-connection.h: (prelude_db_connection_get_sql) new function * src/db-object-selection.c: * src/include/db-object-selection.h: (prelude_db_selected_object_new_string) new function, it should be used by the bindings * bindings/python/*: new files python binding support 2003-12-21 Nicolas Delon <delon.nicolas@wanadoo.fr> * src/db-interface.c: * src/include/db-interface.h: * src/include/plugin-format.h: * plugins/format/classic/idmef-db-select.c: * plugins/format/classic/include/idmef-db-select.h: * plugins/format/classic/classic.c: add a "limit" and an "offset" parameter to the prelude_db_interface_get_{alert,heartbeat}_ident_list functions and add an "offset" parameter to the prelude_db_interface_select_values function * bindings/perl/PreludeDB.c: regenerated * bindings/perl/PreludeDB.pm: fit changes of limit and offset stuff 2003-12-19 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-select.c: (relation_to_sql) bug fix for substr relation 2003-12-19 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/schema.txt: add support for {alert,heartbeat}.analyzer.{node,process}* objects 2003-12-14 Yoann Vandoorselaere <yoann@prelude-ids.org> * src/db-message-cache.c (cache_write_cb): fix a NULL pointer dereference in the messaging subsystem that would trigger if the cached alert we were written was to big. Return the recycled message. 2003-12-14 Nicolas Delon <delon.nicolas@wanadoo.fr> * src/db-cache.c: renamed in src/db-message-cache.c little code cleanup * src/db-interface.c: * src/include/db-interface.h: make db-interface use db-message-cache * bindings/perl/Prelude.c: regenerated * bindings/perl/Prelude.pm: updated to use cache feature of db-interface 2003-12-13 Yoann Vandoorselaere <yoann@prelude-ids.org> * configure.in: stop overwritting user provided CFLAGS. * src/sql-connection-data.c: remove useless NULL check. * src/include/Makefile.am (includedir): * src/Makefile.am (libpreludedb_la_SOURCES): * src/include/db-cache.h: * src/db-cache.c: database caching mechanism implementation. 2003-12-10 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-insert.c: * plugins/format/classic/idmef-db-select.c: fit last changes of libprelude (stuff moved from idmef-util.c to idmef-time.c) 2003-11-30 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: (PreludeDB::delete_alert) (PreludeDB::delete_heartbeat) bug fix, forgot to port this two functions to the last changes of the libpreludedb C API 2003-11-23 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.i: updated to fit the new db-message-ident.[ch] * bindings/perl/PreludeDB.pm: updated to fit the new db-message-ident.c and the API changes of format plugin code cleanup * plugins/format/classic/classic.c: updated to fit the new db-message-ident.c code cleanup * plugins/format/classic/idmef-db-delete.c: * plugins/format/classic/include/idmef-db-delete.h: updated to fit the new db-message-ident.c * plugins/format/classic/idmef-db-select.c: bug fix, handle correctly is_null and is_not_null relations * plugins/sql/mysql/mysql.c: remove the double queries limitation * plugins/sql/pgsql/pgsql.c: remove the double queries limitation bug fix, db_query did not return NULL for table with 0 row * src/db-message-ident.c: * src/include/db-message-ident.h: new files provide message ident manipulation functions * src/db-interface-string.c: include db-message-ident.h * src/db-interface.c: * src/include/db-interface.h: the API for alert ident list retrieving has been changed in order to be more efficient code cleanup * src/db.c: * src/include/db.h: include db-message-ident.h prelude_db_shutdown now returns void instead of int * src/format-plugins.c: include db-message-ident.h * src/include/plugin-format.h: API has been changed to provide a more efficient to way to handle alert lists * bindings/perl/PreludeDB.c: regenerated 2003-11-19 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-insert.c: bug fix, idmef_source_spoofed_to_string does not exist anymore, replace it by idmef_spoofed_to_string thanks to John Green for pointing that out 2003-11-18 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: bug fix (IDMEFSelection did not longer exist) 2003-11-17 Nicolas Delon <delon.nicolas@wanadoo.fr> * src/db-object-selection.c: * src/include/db-object-selection.h: new files replace idmef-selection * bindings/perl/PreludeDB.i: * bindings/perl/PreludeDB.pm: * plugins/format/classic/classic.c: * plugins/format/classic/idmef-db-select.c: * plugins/format/classic/include/idmef-db-select.h: * src/db-interface-string.c: * src/db-interface-string.c: * src/db-interface.c: * src/db.c: * src/format-plugins.c: * src/include/plugin-format.h: fit new selection stuff changes * bindings/perl/PreludeDB.c: regenerated 2003-11-05 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-get.c: fit libprelude changes (*_find_{string,numeric} functions renamed in *_to_{string,numeric}) 2003-10-25 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: remove idmef_selection build related code use new libprelude perl's IDMEFSelection 2003-10-25 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: (PreludeDB::get_values) updated to use distinct stuff * plugins/format/classic/idmef-db-select.c: (build_request) fix a bug introduced when "SELECT DISTINCT" has been reintroduced: the two last arguments of strbuf_sprintf where not took into account because two "%s" where missing in the format string 2003-10-23 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-get.c: * plugins/format/classic/idmef-db-insert.c: fit idmef-tree last changes 2003-10-21 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/include/plugin-format.h: * src/include/db-interface.c: * src/db-interface.c: * plugins/format/classic/classic.c: * plugins/format/classic/idmef-db-select.c: * plugins/format/classic/include/idmef-db-select.h: reintroduced support for "SELECT DISTINCT". * plugins/format/classic/include/idmef-db-select.h: #define'd some useful symbolic names for three int parameters of idmef_db_select(). * bindings/perl/PreludeDB.c: regenerated. 2003-10-21 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-select.c: (table_list_to_strbuf): renamed to table_list_to_strbuf_for_alerts(). (table_list_to_strbuf_for_values): implemented. This function uses right joins as opposed to table_list_to_strbuf_for_alerts(). (build_request): (idmef_db_select): take a parameter specifying if we are extracting complete alerts or values accross the alerts; use left and right joins respectively * plugins/format/classic/idmef-db-select.h: * plugins/format/classic/classic.c: modified accordingly. 2003-10-20 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.i: * bindings/perl/PreludeDB.pm: code review: fixes and cleanup * bindings/perl/PreludeDB.c: regenerated 2003-10-18 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/classic.c: bug fix: build value the right way 2003-10-12 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: (PreludeDB::DESTROY) (PreludeDBSQLRow::DESTROY) <<<grab from the ChangeLog of libprelude, we have exactly the same problem in libpreludedb>>> "bug" fix/workaround some code like this: perl -e "use Prelude; $message = new IDMEFMessage" (note that I did not use "my") leads to call IDMEFMessage::DESTROY -> idmef_message_destroy with a NULL pointer (because the swig intermediate object has been destroyed before the top IDMEFMessage::DESTROY is called itself) this is very bizarre, and only happen for non-my variable at perl exit stage, perl -e "use Prelude; my $message = new IDMEFMessage" will work perl -e "use Prelude; $message = new IDMEFMessage; $message = undef" will also work indeed, perl is great language ;) 2003-10-12 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-insert.c: (insert_additional_data) fit idmef_additional_data_to_string changes 2003-10-08 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.c: regenerated * bindings/perl/PreludeDB.pm: fit idmef-criteria changes * plugins/format/classic/classic.c: fit idmef-criteria changes * plugins/format/classic/idmef-db-select.c: * plugins/format/classic/include/idmef-db-select.h fit idmef-criteria changes criterion_to_sql has been splited up in two functions: criteria_to_sql and criterion_to_sql * plugins/format/classic/schema.txt: add the support of the following objects: heartbeat.create_time heartbeat.analyzer_time alert.create_time alert.analyzer_time * src/db-interface.c: * src/include/db-interface.h: fit idmef-criteria changes * src/sql.c: fit idmef-criteria changes * src/include/plugin-format.h: fit idmef-criteria changes 2003-09-21 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: (get_alert_uident_list) (get_heartbeat_uident_list) (get_values) those functions can accept directly a criterion string as a criterion * plugins/format/classic/idmef-db-insert.c: check return value of idmef_get_db_timestamp and idmef_get_ntp_timestamp functions * plugins/format/classic/idmef-db-select.c: (value_to_sql) new function support for idmef_date in idmef_criterion * plugins/format/classic/schema.txt: add support of alert.detect_time object 2003-09-19 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm (PreludeDB::get_values) bug fix 2003-09-19 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.c: regenerated * bindings/perl/PreludeDB.pm: add the get_values function * plugins/format/classic/classic.c: check idmef_object_value_new's return value and destroy objval when idmef_object_value_list_add failed 2003-09-18 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.c: regenerated * plugins/format/classic/classic.c: modifications to fit changes of idmef_db_select's prototype (classic_get_values) skip empty lines (lines where all fields are NULL) don't build value depending of object because of sql functions (for example, count for a string field returns a number) * plugins/format/classic/idmef-db-select.c: lot of changes and cleanup to support GROUP BY, ORDER BY and LIMIT distinct is not used anymore, use group by instead * src/db-interface.c: * src/include/db-interface.h: * src/include/plugin-format.h: (prelude_db_interface_select_values) (format_select_values) function's prototype changes, remove distinct and add limit argument 2003-09-15 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: * plugins/format/classic/classic.c: * plugins/format/classic/idmef-db-select.c: changes to fit modifications in libprelude's idmef_selection 2003-09-12 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.i: cleanup, do not cut & paste the prototypes of functions used, instead, include directly the needed headers * bindings/perl/PreludeDB.c: regenerated * bindings/perl/PreludeDB.pm: some fixes in sql related functions 2003-09-08 Yoann Vandoorselaere <yoann@prelude-ids.org> * src/db-interface.c (prelude_db_interface_new): check for NULL strdup return value. * src/db-interface.c (prelude_db_interface_activate): (prelude_db_interface_deactivate): theses functions are deprecated. Remove them. (prelude_db_interface_get_alert_uident_list): (prelude_db_interface_get_heartbeat_uident_list): check malloc() error return. (prelude_db_interface_connect): (prelude_db_interface_get_format): (prelude_db_interface_disconnect): (prelude_db_interface_new): code cleanup. (prelude_db_interface_disconnect): remove call to the prelude_db_interface_deactivate(). (prelude_db_interface_new): (prelude_db_interface_connect): (prelude_db_interface_activate): (prelude_db_interface_deactivate): (prelude_db_interface_insert_idmef_message): (prelude_db_interface_get_alert_uident_list): (prelude_db_interface_get_heartbeat_uident_list): interface->active is not needed. Remove format_name, and use the plugin->name field provided by the generic plugin structure. 2003-09-02 Yoann Vandoorselaere <yoann@prelude-ids.org> * src/db-interface-string.c (get_sql_connection_data): reworked this function so that it is easy to add new parameters. You now just have to add a parameters name and handling function to the array of structure in order for the parameter to be taken into account. 2003-08-30 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.i: update the binding interface to the last API changes * bindings/perl/PreludeDB.c: regenerated * bindings/perl/PreludeDB.pm: (PreludeDB::new) restore the removed constructor code and also accept directly connection string update the binding interface to the last API changes (PreludeDB::get_alert) restore the old function's implementation which already "treat empty @object_list as undefined" (PreludeDB::get_heartbeat) some fixes * plugins/format/classic/idmef-db-select.c: (table_list_destroy) fix a memory leak (tlist->top_table was not freed) * plugins/format/classic/classic.c: (classic_select_values) some modifications to fit the last idmef_object_value_new's changes * plugins/format/classic/classic.c: * plugins/format/classic/idmef-db-delete.c: * plugins/format/classic/idmef-db-get.c: * plugins/format/classic/idmef-db-select.c: * plugins/format/classic/include/idmef-db-delete.h: * src/db-interface-string.c: * src/db-interface.c: * src/db.c: * src/format-plugins.c: * src/include/db-interface.h: * src/include/plugin-format.h: * src/include/db-uident.h: API changes, an alert/heartbeat was previously identified by its ident field which is an uint64_t, however IDMEF tell: """ The "ident" attribute by itself provides a unique identifier only among all the "ident" values sent by a particular analyzer. But when combined with the "analyzerid" value for the analyzer, a value that is unique across the intrusion detection environment is created. """ so now, an alert is identified by the couple analyzerid + alert_ident which MUST be unique among the others in the db the current db schema does not respect this, but the new one will 2003-08-19 Yoann Vandoorselaere <yoann@prelude-ids.org> * src/strbuf.c (strbuf_new): use similar OOM warning as we have in other place in the code. coding style fix. 2003-08-14 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * bindings/perl/PreludeDB.pm: (PreludeDB::new): pass connection string directly to prelude_db_interface_new_string(), instead of parsing (since parser does not seem to work anyhow). (_convert_object_list): adapted to changed idmef-selection API (get_alert): treat empty @object_list as undefined * plugins/format/classic/classic.c: (classic_get_alert): fixed an idiotic bug in handling NULL selection. 2003-08-13 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * bindings/perl/PreludeDB.i: modified to reflect recent API changes. * bindings/perl/PreludeDB.c: regenerated. 2003-08-12 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-select.c: (aggregate_function_to_sql): implemented. (add_field): (relation_to_sql): handle aggregate functions (build_request): (idmef_db_select): handle 'distinct' parameter * plugins/format/classic/classic.c: handle aggregate functions. (classic_select_values): (classic_get_values): implemented. (classic_get_alert): (classic_get_heartbeat): force full alert extraction under conditions where partial extraction can produce incorrect results * src/include/db-interface.h: * src/db-interface.c: style fixes (prelude_db_interface_select_values): (prelude_db_interface_get_values): implemented * src/include/plugin-format.h: added format_select_values and format_get_values callbacks 2003-08-02 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-select.c: (table_entry_new): bug fix: free entry AFTER its fields have been freed * plugins/sql/mysql/mysql.c: (db_begin) check session's status before doing anything * plugins/sql/pgsql/pgsql.c: (db_begin) check session's status before doing anything 2003-07-26 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-select.c: (idmef_db_select): fix a possible NULL pointer dereference when compiled with -DDEBUG 2003-07-14 Nicolas Delon <delon.nicolas@wanadoo.fr> * src/db-interface.c: (prelude_db_interface_disconnect) fix a bug, interface->db_connection was not set to NULL after it has been destroyed * bindings/perl/PreludeDB.i: * bindings/perl/PreludeDB.pm: (PreludeDB) add the disconnect function * bindings/perl/PreludeDB.c: regenerated 2003-07-09 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: return value of function like PreludeDB::init that returns an integer to indicate if the function failed or not has changed: before the changes, functions returned a value < 0 if the function failed or a value >= 0 otherwise now, the functions return 0 if the function failed or another value otherwise this choice has been done to follow the perl's "conventions" in this domain 2003-07-09 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: add a 1 (true value) at the end of the package's code * plugins/format/classic/idmef-db-get.c: (get_user) bug fix, "parent" was passed as parent argument of function get_userid instead of "user" 2003-07-08 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-insert.c: bug fix, code cleanup, port to the new IDMEF API * plugins/format/classic/schema.txt: add the alert.target.service.port object 2003-07-06 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB.pm: support full message fetching * plugin/format/classic/idmef-db-delete.c: fix two bugs in alert/heartbeat deletion code (bad test for deletion of Prelude_Address row, and Prelude_Heartbeat rows were not deleted in classic_delete_heartbeat) 2003-07-04 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-delete.c: * plugins/format/classic/include/idmef-db-delete.c: new files * bindings/perl/PreludeDB.c: regenerated * bindings/perl/PreludeDB.i: * bindings/perl/PreludeDB.pm: * plugins/format/classic/classic.c: * src/db-interface.c: * src/include/db-interface.h: * src/include/plugin-format.h: support the deletion of alert/heartbeat 2003-07-03 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/classic.c: include "idmef-db-get.h" * plugins/format/classic/idmef-db-get.c: (get_user): fixed error detection. * plugins/format/classic/schema.txt: newer version. 2003-07-02 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/classic.c: * plugins/format/classic/schema.txt: support whole message fetching for heartbeat 2003-07-02 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-select.c: (normalize_condition): implemented. (table_entry_new): copy criteria into table entry structure. Fixed memory leaks in error handling. (table_list_to_strbuf): put condition in bracket (just in case) (add_table): normalize condition before matching with condition in the table entry structure (criterion_to_sql): use aliased table names. (build_request): compile table list after processing criteria * plugins/format/classic/schema.txt: new version of database schema file, courtesy of Davor Ocelic <docelic@mail.inet.hr>. 2003-07-01 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/classic.c: (get_message): more readable debug messages :). Handle 1-to-N relations better ( still not perfect :( ). Don't check if selection is NULL, the calling function already does that. * plugins/format/classic/idmef-db-select.c: don't try to build the FROM ... LEFT JOIN ... statements at once; instead, first build a table list and then compile to SQL. Alias all tables. That should make extracting values with 1-to-N relations work correctly. Add a debug messsage containing a number of rows extracted. 2003-06-30 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/idmef-db-get.c: * plugins/format/classic/include/idmef-db-get.h: new files add the support of a whole message fetching * plugins/format/classic/classic.c: (classic_get_alert): call get_alert when the selection argument is NULL in order to fetch the whole message 2003-06-27 Nicolas Delon <delon.nicolas@wanadoo.fr> * src/sql.c: * src/include/sql.h: (prelude_sql_field_value_int16): (prelude_sql_field_value_uint16): new functions 2003-06-23 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/classic.c: (get_message): add some log() statements to help debugging. 2003-06-23 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/classic.c: (get_message): handle NULL fields correctly. * plugins/format/classic/idmef-db-select.c: build query differently, using LEFT JOIN statements. This allows to handle empty tables / records correctly when used along with filled ones. 2003-06-23 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/classic.c: (get_message): call idmef_selection_set_object_iterator() before processing each row. Use idmef_value_new_for_object() instead of idmef_value_new_generic() to handle enums correctly. 2003-06-22 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/classic.c: (get_message): don't use prelude_sql_field_idmef_value(), do convertion manually, obtaining variable type via idmef_object_get_type(). This is caused by some braindead type mappings (uint64_t as STRING, eh?). 2003-06-01 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-select.c: (objects_to_sql): remove unneeded cached_obj variable. 2003-05-29 Nicolas Delon <delon.nicolas@wanadoo.fr> * bindings/perl/PreludeDB/*: removed * bindings/perl/*: new files, the perl binding has been rewritten using swig * configure.in: * Makefile.am: modified to support the perl binding in the build process * plugins/format/classic/idmef-db-select.c: in criterion_to_sql, check if db_object_find's return value is NULL rename idmef_object_get_num function's call in idmef_object_get_numeric because idmef_object_get_num does not exist 2003-05-19 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/classic.c: * plugins/format/classic/idmef-db-select.c: * plugins/format/classic/include/idmef-db-select.h: * src/sql.c: * src/include/sql.h: * src/db-interface.c: * src/include/db-interface.h: * src/include/plugin-format.h: libpreludedb API changes, idmef_cache is not used anymore, idmef_selection is now used for object selection and idmef_message is used to store the fetched fields 2003-05-18 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/schema.txt: minor modification to fit idmef_data's last changes * plugins/format/classic/classic.c: minor modifications to fit the idmef_criterion_new's changes 2003-05-13 Nicolas Delon <delon.nicolas@wanadoo.fr> * src/sql-plugins.c: * src/sql.c: minor modifications to fit idmef_string's last changes 2003-05-08 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/include/idmef-db-select.h: * plugins/format/classic/include/idmef-db-insert.h: change #define'd constants names to match file names. 2003-05-08 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> (these modifications should have been checked in on 2003-05-05) * plugins/format/classic/include/idmef-db-output.h: renamed to idmef-db-insert.h * plugins/format/classic/include/idmef-db-read.h: renamed to idmef-db-select.h * plugins/format/classic/include/idmef-db-select.h: apply modifications corresponding to those in idmef-db-select.c 2003-05-05 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-select.c: (objects_to_sql): avoid a SIGSEGV in a situation when a requested object is not present in database schema. 2003-05-05 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/sql/mysql/mysql.c(db_query): fix a bug that returned a non-null pointer for select that returns no rows (this bug was introduced in the last mysql.c modification by using mysql_store_result which has not the same behaviour that mysql_use_result * plugins/format/classic/Makefile.am: the last fix did not work, this one works * src/db-interface.c: * src/include/db-interface.h: a lot of modifications, now, we provide a higher level (easier to use, more efficient) of abstraction on top of the sql database * plugins/format/classic/idmef-db-output.c: has been renamed in idmef-db-insert.c * plugins/format/classic/idmef-db-read.c: has been renamed in idmef-db-select.c * plugins/format/classic/classic.c: * plugins/format/classic/idmef-db-insert.c: * plugins/format/classic/idmef-db-select.c: a lot of modifications to fit the new format plugin API 2003-05-05 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/sql.c: (prelude_sql_field_idmef_value): modify to accomodate a change in idmef_string_new() syntax. 2003-04-27 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-read.c: fix compilation warnings. (objects_to_sql): fix possible use of uninitialized values on error. (criterion_to_sql): modified to reflect recent libprelude API changes (relation_less, relation_greater). * src/gdb.c: fix warnings. 2003-04-01 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/classic.c(add_criterion): use idmef_value_ref() instead of idmef_value_clone() 2003-03-16 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-read.c: (build_request): handle queries without WHERE clause 2003-03-16 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-read.c: (criterion_to_sql): handle empty criteria chain correctly 2003-03-14 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/format/classic/Makefile.am fix a compilation rule error 2003-02-21 Nicolas Delon <delon.nicolas@wanadoo.fr> * plugins/sql/mysql/mysql.c: functions prelude_sql_{fields,rows}_num works now, mysql_use_result has been replaced by mysql_store_result Thanks to Vincent Glaume for the bug report. * src/include/sql.h: add a comment to explain what does the return value of the prelude_sql_field_fetch mean * plugins/format/classic/Makefile.am: link classic.so against libpreludedb in order to make the perl binding working 2003-02-18 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/pgsql.sql: included a patch from Herve Debar <herve.debar@francetelecom.com> (commenting out an unneeded ",") 2003-02-15 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-read.c: use SELECT DISTINCT instead of SELECT (eliminates duplicates introduced by 1-to-N relations). 2003-02-15 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/idmef-db-read.c: fix handling of 1-to-N relations * src/idmef-object-list.c: * src/include/idmef-object-list.h: removed. * src/Makefile.am: * src/include/Makefile.am: updated accordingly. 2003-02-14 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * configure.in: add a variable for directory for holding configuration of format plugins * plugins/format/classic/Makefile.am: add plugin and config directories to DEFS. compile db-object.c. install schema.txt. * plugins/format/classic/include/db-object.h * plugins/format/classic/db-object.c: * plugins/format/classic/schema.txt: new file. Parser and config file for describing database structure * plugins/format/classic/include/idmef-db-read.h: * plugins/format/classic/idmef-db-read.c: * plugins/format/classic/classic.c: add IDMEF message reading support. * src/idmef-db-values.c: * src/include/idmef-db-values.h: Removed. idmef_cache_t used instead. * src/Makefile.am: * src/include/Makefile.am: updated accordingly * src/db-interface-string.c: * src/db-interface.c: * src/db.c * src/format-plugins.c: * src/include/db-interface.h: * src/include/plugin-format.h: modify to reflect used API. * src/include/param-string.h * src/param-string.c: fix various bugs resulting in SIGSEGVs (strbuf_sprintf): handle empty strings correctly (strbuf_string): (strbug_empty): (strbuf_clear): implemented * src/db.c: change comment to indicate that reinitialization attempts are OK 2003-01-17 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/classic.c: remove obsoleted call to set_state() (to fix linker error ;P) 2003-01-16 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/classic: removed unnecessary plugin (un)subscription code. 2003-01-11 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/format/classic/Makefile.am: link the plugin dynamically against libprelude to avoid linker errors when used from Perl. * bindings/*: new files. Perl 5.8 bindings from Nicolas Delon <delon.nicolas@wanadoo.fr> 2003-01-07 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/sql/mysql.c: * plugins/sql/pgsql.c: (db_query): don't change session status to st_query if there are no results. Remove unneeded st_transaction state (backend will check these things anyhow). Patch from Nicolas Delon <delon.nicolas@wanadoo.fr> (with my cooperation ;)). * src/sql.c: Patch from Nicolas Delon <delon.nicolas@wanadoo.fr>: (prelude_sql_insert): fix bug in error handling. (prelude_sql_row_free): Check for NULL argument. (prelude_sql_field_info_type): Implemented. * src/include/sql.h: Patch from Nicolas Delon <delon.nicolas@wanadoo.fr>: updated accordingly. * plugins/format/classic/idmef-db-output.c: added error handling. Added transaction support: BEGIN; at the start, COMMIT; when we're done or ROLLBACK on error. Finally :) * src/idmef-db-values.c: * src/include/idmef-db-values.h: new file. Implementation of container datatype for data read from database will be placed here. * src/strbuf.c: * src/include/strbuf.h: new file. Provides a dynamically resizable char * buffer. * src/idmef-object-list.c: * src/include/idmef-object-list.h: new file. Local implementation of lists of idmef_object_t objects. * src/Makefile.am: * src/include/Makefile.am: modified accordingly * src/plugin-format.h: API change: add hooks for alert reading function. * plugins/format/classic/idmef-db-read.c: * plugins/format/classic/include/idmef-db-read.h: new file. Alert reading code will be placed here. * plugins/format/classic/classic.c: register callback for alert reading. Remove check for database type duplicating the one from idmef-db-output.c. * plugins/format/classic/Makefile.am: modified accordingly. * plugins/format/classic/include/idmef-db-output.h: change preprocessor macros to avoid names clash. * plugins/format/classic/classic.c: add support for alert reading API. * src/db-interface.c: * src/include/db-interface.c: (prelude_db_interface_read_idmef_objects): implemented. * src/db.c: fix includes adapting to new API. Update copyright notice. * src/format-plugins.c: fix includes adapting to new API. 2003-01-04 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/sql/mysql/mysql.c: * plugins/sql/pgsql/pgsql.c: * src/include/plugin-sql.h: * src/include/sql.h: * src/sql.c: updated copyright notices * src/sql.c(prelude_sql_field_value_idmef): call idmef_value_have_own_data() after bulding idmef_string_t object. 2003-01-03 Nicolas Delon <delon.nicolas@wanadoo.fr> * src/include/plugin-sql.h: sql plugin API re-designed we no longer convert the database result in our own format we no longer use the errno global variable, instead of this, the sql plugin must maintain an internal errno-type variable * src/{sql.c,include/sql.h}: a lot of changes to fit the new sql plugin API * src/{sql-table.c,include/sql-table.h}: as we are not doing results conversion anymore, those files have been deleted * plugins/sql/mysql/mysql.c: a lot of changes to fit the new sql plugin API dbport argument in db_setup is supported code cleanup, we no longer use mysql API deprecated functions we no longer fetch the query result in one time, instead of this, we fetch the result row by row * plugins/sql/pgsql/pgsql.c a lot of changes to fit the new sql plugin API 2003-01-01 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-interface-string.c(get_sql_connection_data): free 'data' structure correctly on error. Happy New Year :) 2002-12-31 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-interface-string.c(get_sql_connection_data): fix memory leaks on errors. 2002-12-31 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-interface-string.c(get_sql_connection_data): add handling of "port" keyword. 2002-12-20 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/sql/pgsql.c(db_query): fix a memory leak and a possible NULL pointer dereference on error. Thanks to Nicolas Delon <delon.nicolas@wanadoo.fr> for pointing this out. 2002-12-19 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/sql/mysql.c Remove no longer used connection_closed state. (db_connect): modify accordingly (db_cleanup): rename to cleanup. Change type to void. Remove unneeded check for connection state. (db_close): call cleanup(). * plugins/pgsql/pgsql.c: ditto. * src/db-connection-data.c(prelude_db_connection_data_destroy): add missing call to free the structure. * src/db-connection.c: * src/include/db-connection.h: (prelude_db_connection_destroy): implemented. * src/db-interface-string.c: fix memory leaks related to calls to parameter_value() * src/db-interface.c (prelude_db_interface_new): set interface state to active after creating (prelude_db_interface_destroy): don't abort on prelude_db_interface_deactivate() error add missing call to prelude_db_connection_destroy() * src/sql.c (prelude_sql_escape): style fix. (prelude_sql_close): free() the structure 2002-12-19 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/sql/mysql/mysql.c: implement handling of queries returning results (this has been done by Nicolas Delon <delon.nicolas@wanadoo.fr>) 2002-12-14 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/sql-table.c: add missing copyright notice. 2002-12-14 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-interface.c: allow interface specification with format = NULL * src/db-interface.c: * src/include/db-interface-h: (prelude_db_interface_get_connection) (prelude_db_interface_get_connection_data) new function. * src/sql-table.c: * src/include/sql-table.h: rename prelude_sql_row_add_field() to prelude_sql_row_set_field() to reflect actual behavior. Add new function prelude_sql_row_get_width(). * plugins/sql/pgsql/pgsql.c(get_query_result): fix a bug preventing function from working :-) (add missing call to prelude_sql_row_set_field()) 2002-12-09 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/include/sql.h: * src/include/sql-table.h: * src/include/param-string.h: add missing copyright notice * src/include/param-string.h: add missing #ifdef 2002-12-09 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/sql-table.c: * src/include/sql-table.h: prefix public functions and structures with prelude_ (so all public SQL functions are now prefixed with prelude_sql_) * plugins/sql/mysql/mysql.c: * plugins/sql/pgsql/pgsql.c: * src/sql.c: * src/include/sql.h: * src/include/plugin-sql.h: update accordingly. * src/include/plugin-sql.h: add missing plugin_init() prototype. * src/include/format.h: removed. 2002-12-09 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/include/format.h: * src/sql.c: prefix public functions and structures with prelude_ * src/include/format.h: * src/db-interface.c: * plugins/format/classic/idmef-db-output.c: modified accordingly 2002-12-09 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/include/sql.h: * src/sql.c: SQL connection handling code from sql-plugins.c. sql_connection_t structure made opaque. sql.h is a public header, offering application access to our SQL layer. * src/sql-plugins.c: * src/include/plugin-sql.h: remove code moved to sql.[ch]. * src/Makefile.am: * src/include/Makefile.am: modified accordingly * plugins/format/classic/classic.c: * plugins/format/classic/idmef-db-output.c: * src/db-interface.c: include "sql.h" instead of "plugin-sql.h" 2002-12-07 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-interface-string.c: remove unneeded includes. 2002-12-07 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-interface.c(prelude_db_interface_connect): add missing "break" statement * src/db-interface-string.c: * src/include/db-interface-string.h: new file. Reintroducing "ODBC-style" constructor for prelude_db_interface_t. * src/Makefile.am: * src/include/Makefile.am: update accordingly. 2002-12-07 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/sql-connection-data.c: handle NULL parameter values correctly in all functions * src/include/db-type.h: define prelude_db_type_invalid 2002-12-07 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-interface.c: don't include "param-string.h" 2002-12-07 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-interface.c(prelude_db_interface_new): avoid problems when 'format' or 'name' parameter is NULL 2002-12-07 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/include/db-type.h: new file. prelude_db_type_t moved from db-connection.h * src/include/db-connection.h: modified accordingly. * src/include/Makefile.am: modified accordingly. * plugins/format/classic/classic.c: * plugins/format/classic/idmef-db-output.c: * src/db-connection.c: * src/db-interface.c: * src/db.c: * src/format-plugins.c: * src/sql-plugins.c: include "db-type.h" * src/sql-connection-data.c: * src/include/sql-connection-data.h: (prelude_sql_connection_data_set_name): (prelude_sql_connection_data_get_name): implemented. * src/param-string.c: declare local functions as static 2002-12-07 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-interface.c: * src/include/db-connection-data.c: add missing copyright notice 2002-12-07 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-connection-data.c * src/include/db-connection-data.c * src/db-interface.c * src/include/db-interface.h * src/sql-connection-data.c * src/include/sql-connection-data.h new files. Object model for connection management has been totally reworked using opaque datatypes and should finally be correct. * src/db-connection.c: * src/include/db-connection.h: remove code regaring interface object (moved to db-interface.[ch]). Change structure of prelude_db_connection_t and make opaque. * src/db.c: * src/include/db.h: don't include anything in .h * plugins/format/classic/classic.c: * plugins/format/classic/idmef-db-output.c: modify code as necessary * plugins/sql/mysql/mysql.c: * plugins/sql/pgsql/pgsql.c: fix includes accordingly * src/Makefile.am: * src/include/Makefile.am: modify accordingly 2002-09-24 Yoann Vandoorselaere <yoann@mandrakesoft.com> * src/db-connection.c (prelude_db_interface_new): (prelude_db_interface_set_name): (prelude_db_interface_set_type): (prelude_db_interface_set_format): (prelude_db_interfave_set_host): (prelude_db_interface_set_port): (prelude_db_interface_set_user): (prelude_db_interface_set_pass): (prelude_db_interface_connect): Implemented. We're now using an object oriented model. Still, we have to abstract access to the prelude_db_interface_t structure which remain pubmic for now. 2002-09-20 Yoann Vandoorselaere <yoann@mandrakesoft.com> * plugins/format/classic/mysql.sql: * plugins/format/classic/pgsql.sql: add missing field for good File table handling. * plugins/format/classic/idmef-db-output.c (insert_file_list): increase file_ident on each File insertion. (insert_file): take a file_ident argument. 2002-09-18 Yoann Vandoorselaere <yoann@mandrakesoft.com> * plugins/db/mysql/mysql.sql: add the file_ident member to the Prelude_Inode table. Add the ident member to the Prelude_File table. 2002-09-16 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/sql/mysql/mysql.sql: * plugins/sql/pgsql/postgresql.sql: moved to plugins/format/classic (quite logical ;-)). Renamed postgresql.sql to pgsql.sql. 2002-09-15 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugin/sql/mysql.c: * plugin/sql/pgsql.c: fixed a serious connection state handling bug (transactions were not marked as terminated). Cleanup. * plugin/sql/mysql.c: * plugin/sql/pgsql.c: * src/sql-plugins.c: * src/include/plugins-sql.c: remove unnecessary db_insert() in favor of db_command(). 2002-09-12 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db-connection.c: * src/include/db-connection.h: removed support for connection lists. This should be done in the application. Added a new ODBC-style common connection interface (prelude_db_connect). * src/param-string.c * src/include/param-string.h: Functions needed for parsing connection configuration strings. 2002-09-09 Yoann Vandoorselaere <yoann@mandrakesoft.com> * src/idmef-db-output.c (insert_analyzer): use parent_type instead of the 'A' string constant. Fix a possible IDMEF heartbeat insertion error. 2002-08-27 Yoann Vandoorselaere <yoann@mandrakesoft.com> * src/sql-table.c: made sql_field_t, sql_row_t, sql_table_t be opaque datatype, for the sake of binary compatibility. * lot of cleanup, handle session the right way (tm). 2002-08-26 Yoann Vandoorselaere <yoann@mandrakesoft.com> * src/sql-plugins.c: if va_copy isn't defined (C99), check for __va_copy (C89). If __va_copy isn't available, then fallback on the memcpy() method, but give a compile warning as well explaining this might result in undefined behavior on certain architecture. generate_query(): copy the variable argument list in case generate_dynamic_query() is to be called. This avoid undefined behavior on some architecture, where you can't use a variable argument list twice. * src/sql-plugins.c (sql_query): (sql_insert): kill code duplication, use generate_query(). (generate_query): new function. Fix an off by one in sql_insert() and sql_query. * configure.in: pre-require autoconf 2.53. 2002-08-25 Yoann Vandoorselaere <yoann@mandrakesoft.com> * src/format-plugins.c: avoid using global variable when possible. Style fix. 2002-08-23 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/db/mysql/mysql.c: * plugins/db/pgsql/pgsql.c: fix a bug causing first assigned session ID to have number 1 instead of 0. * plugins/db/mysql/mysql.c: * plugins/db/pgsql/pgsql.c: remove not needed prelude_option stuff * plugins/db/mysql/mysql.c: * plugins/db/pgsql/pgsql.c: * src/sql-plugins.c: * include/plugins-sql.h: change db_escape() prototype. Session identifier must be passed to the function so mysql_real_escape_string() can be used. * plugins/db/mysql/mysql.c: * plugins/db/pgsql/pgsql.c: * plugins/formats/classic/classic.c: * plugins/formats/classic/idmef-db-output.c: * src/sql-plugins.c: improve error handling and messages, remove debugging printf()'s and log()'s. * README: new file. Instructions for new users. ;-) 2002-08-23 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * plugins/db/mysql/Makefile.am: * plugins/db/mysql/mysql.c: port the plugin to new API. Mostly functional, but missing db_query() function (currently not used). * plugins/db/Makefile.am: enable MySQL plugin 2002-08-22 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * src/db.c src/include/db.h: cleanup. No longer dependant on (argc, argv). Change function prefix to prelude_db. * src/db-connection.c, src/include/db-connection.h: cleanup. Improved database interface handling code. Change function prefix to prelude_db. 2002-08-22 Krzysztof Zaraska <kzaraska@student.uci.agh.edu.pl> * Initial commit: Supports writing data in old Prelude format to PostgreSQL database. Certain files / directories not (yet) used. Needs cleaning.