Hello community, here is the log from the commit of package ulogd checked in at Wed Jan 10 18:17:24 CET 2007. -------- --- ulogd/ulogd.changes 2006-06-22 18:19:22.000000000 +0200 +++ /mounts/work_src_done/STABLE/ulogd/ulogd.changes 2007-01-10 11:20:05.000000000 +0100 @@ -1,0 +2,14 @@ +Wed Jan 10 11:19:31 CET 2007 - mt@suse.de + +- Bug #229970: fixed several string length calculations + New patch file: ulogd-1.23-strfix.dif +- Fixed _init / _fini functions to reset the dbh pointer on + initialization failures, added checks if stmt/dbh pointer + are initialized in output functions. Changed to run _fini + functions before the log file is closed, because they may + log (eg. the sqlite3 plugin). + New patch file: ulogd-1.23-cleanup.dif +- Changed to use more usefull default path in ulogd.conf.in + New patch file: ulogd-1.23-config.dif + +------------------------------------------------------------------- New: ---- ulogd-1.23-cleanup.dif ulogd-1.23-config.dif ulogd-1.23-strfix.dif ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ulogd.spec ++++++ --- /var/tmp/diff_new_pack.M24853/_old 2007-01-10 18:16:52.000000000 +0100 +++ /var/tmp/diff_new_pack.M24853/_new 2007-01-10 18:16:52.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package ulogd (Version 1.23) # -# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -13,8 +13,8 @@ Name: ulogd BuildRequires: libpcap mysql-devel postgresql-devel sqlite-devel Version: 1.23 -Release: 17 -License: GPL +Release: 41 +License: GNU General Public License (GPL) Summary: ulogd - netfilter ULOG target log daemon Group: System/Daemons Autoreqprov: on @@ -28,6 +28,9 @@ Patch0: %{name}-%{version}.dif Patch1: %{name}-%{version}-lib64.dif Patch2: %{name}-%{version}-pgsql-table.dif +Patch3: %{name}-%{version}-strfix.dif +Patch4: %{name}-%{version}-cleanup.dif +Patch5: %{name}-%{version}-config.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %insserv_prereq %fillup_prereq %package sqlite @@ -123,6 +126,9 @@ %patch0 -p0 %patch1 -p0 %patch2 -p0 +%patch3 -p0 +%patch4 -p0 +%patch5 -p0 %build autoconf @@ -210,6 +216,17 @@ %{_includedir}/libipulog %changelog -n ulogd +* Wed Jan 10 2007 - mt@suse.de +- Bug #229970: fixed several string length calculations + New patch file: ulogd-1.23-strfix.dif +- Fixed _init / _fini functions to reset the dbh pointer on + initialization failures, added checks if stmt/dbh pointer + are initialized in output functions. Changed to run _fini + functions before the log file is closed, because they may + log (eg. the sqlite3 plugin). + New patch file: ulogd-1.23-cleanup.dif +- Changed to use more usefull default path in ulogd.conf.in + New patch file: ulogd-1.23-config.dif * Thu Jun 22 2006 - ro@suse.de - remove selfprovides * Tue May 02 2006 - mt@suse.de ++++++ ulogd-1.23-cleanup.dif ++++++ --- mysql/ulogd_MYSQL.c +++ mysql/ulogd_MYSQL.c 2007/01/10 13:02:54 @@ -122,6 +122,9 @@ struct in_addr addr; #endif + if( stmt_val == NULL || dbh == NULL) + return 1; + stmt_ins = stmt_val; for (f = fields; f; f = f->next) { @@ -356,8 +359,11 @@ if (!dbh) return 1; - if (!mysql_real_connect(dbh, server, user, pass, db, port, NULL, 0)) + if (!mysql_real_connect(dbh, server, user, pass, db, port, NULL, 0)) { + mysql_close(dbh); + dbh = NULL; return 1; + } return 0; } @@ -375,10 +381,17 @@ /* read the fieldnames to know which values to insert */ if (mysql_get_columns(table_ce.u.string)) { + mysql_close(dbh); + dbh = NULL; ulogd_log(ULOGD_ERROR, "unable to get mysql columns\n"); return -1; } - mysql_createstmt(); + + if( mysql_createstmt()) { + mysql_close(dbh); + dbh = NULL; + return -1; + } return 0; } --- pgsql/ulogd_PGSQL.c +++ pgsql/ulogd_PGSQL.c 2007/01/10 13:02:54 @@ -112,6 +112,9 @@ struct in_addr addr; #endif + if( stmt_val == NULL || dbh == NULL) + return 1; + stmt_ins = stmt_val; for (f = fields; f; f = f->next) { @@ -439,6 +442,7 @@ free(connstr); if (PQstatus(dbh)!=CONNECTION_OK) { exit_nicely(dbh); + dbh = NULL; return 1; } @@ -457,23 +461,34 @@ } if (pgsql_namespace()) { - return 1; + PQfinish(dbh); + dbh = NULL; ulogd_log(ULOGD_ERROR, "unable to test for pgsql schemas\n"); + return 1; } /* read the fieldnames to know which values to insert */ if (pgsql_get_columns(table_ce.u.string)) { + PQfinish(dbh); + dbh = NULL; ulogd_log(ULOGD_ERROR, "unable to get pgsql columns\n"); return 1; } - pgsql_createstmt(); + if (pgsql_createstmt()) { + PQfinish(dbh); + dbh = NULL; + return 1; + } return 0; } static void pgsql_fini(void) { - PQfinish(dbh); + if( dbh) + PQfinish(dbh); + if( stmt) + free(stmt); } static ulog_output_t pgsql_plugin = { --- sqlite3/ulogd_SQLITE3.c +++ sqlite3/ulogd_SQLITE3.c 2007/01/10 13:02:54 @@ -98,6 +98,8 @@ char *ipaddr; struct in_addr addr; #endif + if (p_stmt == NULL || dbh == NULL) + return 1; col_counter = 0; for (f = fields; f; f = f->next) { @@ -262,15 +264,16 @@ DEBUGP("about to prepare statement.\n"); - sqlite3_prepare(dbh,stmt,-1,&p_stmt,0); - - DEBUGP("statement prepared.\n"); - - if (!p_stmt) { + if( sqlite3_prepare(dbh,stmt,-1,&p_stmt,0) != SQLITE_OK) { + p_stmt = NULL; + free( stmt); + stmt = NULL; ulogd_log(ULOGD_ERROR,"unable to prepare statement"); return 1; } + DEBUGP("statement prepared.\n"); + return 0; } @@ -375,6 +378,7 @@ config_parse_file("SQLITE3", &buffer_ce); if (_sqlite3_open_db(db_ce.u.string)) { + dbh = NULL; ulogd_log(ULOGD_ERROR, "can't open the database file\n"); return 1; } @@ -385,6 +389,8 @@ /* read the fieldnames to know which values to insert */ if (_sqlite3_get_columns(table_ce.u.string)) { + sqlite3_close(dbh); + dbh = NULL; ulogd_log(ULOGD_ERROR, "unable to get sqlite columns\n"); return 1; } @@ -399,7 +405,11 @@ ulogd_log(ULOGD_ERROR,"can't create a new transaction\n"); /* create and prepare the actual insert statement */ - _sqlite3_createstmt(); + if(_sqlite3_createstmt()) { + sqlite3_close(dbh); + dbh = NULL; + return 1; + } return 0; } --- ulogd.c +++ ulogd.c 2007/01/10 13:02:54 @@ -596,14 +596,15 @@ ipulog_destroy_handle(libulog_h); free(libulog_buf); - if (logfile != stdout && logfile != &syslog_dummy) - fclose(logfile); for (p = ulogd_outputs; p; p = p->next) { if (p->fini) (*p->fini)(); } + if (logfile != stdout && logfile != &syslog_dummy) + fclose(logfile); + exit(0); } ++++++ ulogd-1.23-config.dif ++++++ --- ulogd.conf.in +++ ulogd.conf.in 2007/01/05 18:23:47 @@ -73,7 +73,7 @@ host="localhost" [SQLITE3] table="ulog" -db="/path/to/sqlite/db" +db="/var/log/ulogd.sqlite3db" buffer=200 [PCAP] ++++++ ulogd-1.23-strfix.dif ++++++ ++++ 881 lines (skipped) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de