summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Improve pid file handling.Eric Leblond2013-05-211-12/+54
| | | | | | | | | | This patch improves latest patch by splitting in two part the pid file creation. This allows to display a message to stdout when ulogd can not be started. Another linked improvement is that the plugin initialization is not done if the pid file existence will result in a ulogd exit. Signed-off-by: Eric Leblond <eric@regit.org>
* ulogd: Implement PID file writingChris Boot2013-05-211-1/+146
| | | | | | | | The deamon currently does not have the ability to write a PID file to track its process ID. This is very useful to an init script and to ensure there is only one running instance. This patch implements this functionality. Signed-off-by: Chris Boot <bootc@bootc.net>
* ulogd: Perform nice() before giving up rootChris Boot2013-05-211-7/+7
| | | | | | | | The daemon code currently tries to nice(-1) just after having given up root privileges, which fails. This patch moves the nice(-1) call to just before the code that gives up the required privileges. Signed-off-by: Chris Boot <bootc@bootc.net>
* db: add ring buffer for DB queryEric Leblond2013-05-211-1/+1
| | | | | | | | | | | This patch adds an optional ring buffer option which modify the way database queries are made. The main thread is only handling kernel message reading and query formatting. The SQL request is made in a separate dedicated thread. The idea is to try to avoid buffer overrun by minimizing the time requested to treat kernel message. Doing synchronous SQL request, as it was made before was causing a delay which could cause some messages to be lost in case of burst from kernel side.
* ulogd: display stack during configurationEric Leblond2013-04-201-1/+1
|
* Revert "ulogd: close logfile description in the exit path of parent process"Pablo Neira Ayuso2013-03-271-1/+0
| | | | | | | This reverts commit 3179bd4de89de7c2388849f5bc48e8f5aad9e5b9. Pointing to the wrong place. This is not the file descriptor that ulogd is leaking.
* ulogd: close logfile description in the exit path of parent processPablo Neira Ayuso2013-03-261-0/+1
| | | | | | | | | | | | | | | Joan Touzet reported that file descriptor 3 was not ever closed in the exit path of the parent process: open("ulogd.conf", O_RDONLY) = 3 That corresponds to the the file descriptor that was used to parse the configuration file was not closed. This closes: http://bugzilla.netfilter.org/show_bug.cgi?id=793 Reported-by: Joan Touzet <joant@cloudant.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* ulogd: change verbosity of a messageEric Leblond2013-03-201-1/+1
| | | | | The "registering plugin" message is not really useful as the message is really explicit if a plugin is missing.
* Add handling of too long line and arguments.Eric Leblond2013-02-182-1/+28
| | | | | When an argument or a line is too long, it can not be store into ulogd configuration and this must results in a error.
* Use access to ensure readability of config gileEric Leblond2013-02-182-2/+11
| | | | | This patch adds a call to access to check the readability of the configuration file.
* Suppress dead FIXME.Eric Leblond2013-02-181-1/+0
|
* Get rid of SVN tag in comment.Eric Leblond2013-01-185-18/+6
| | | | This patch also update some copyright and licence declaration.
* Add -l option to set log level from command lineEric Leblond2013-01-181-2/+13
| | | | | | This patch adds a '-l' option which can be used to setup ulogd loglevel. Command line option has precedence on the configuration file one.
* conf: add flag to allow option setup tuningEric Leblond2013-01-181-1/+2
| | | | | | This patch adds a flag to the config_entry structure to be able to tune setup. First usage is to ask config parser not to update a key if it has been already set.
* ulogd: add -v option to display message on stderr.Eric Leblond2013-01-061-8/+33
| | | | | If can be painful to have to check the logfile, so this patch adds a '-v' option which display logs message to stderr.
* addr: fix compilation warningEric Leblond2013-01-051-2/+2
| | | | | This patch fixes a compilation warning related to a signed and unsigned integer comparison.
* addr: add file containing addr utility functions.Eric Leblond2013-01-052-1/+114
|
* src: update copyright and authors informationPablo Neira Ayuso2012-08-031-1/+3
| | | | | | | | Include Eric and myself in the copyright notice and the AUTHORS file since we're the most recurrent contributors (of course, after the original author of this software, Harald Welte). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: fix version that -V displaysPablo Neira Ayuso2012-08-031-4/+4
| | | | | | | It was wrong, use VERSION constant which uses the version information available in configure.ac. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* ulogd: fix segfault if syslog and SIGTERM is receivedSalih Gonullu2011-03-271-2/+2
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: avoid use of LIBS variableJan Engelhardt2011-02-011-0/+1
| | | | | | | The variable contains global libraries linked into every possible object, which is unwanted. Clean up things. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* ulogd: fix double call of stop for reused input pluginsPablo Neira Ayuso2011-01-071-2/+12
| | | | | | | | | | | This patch adds reference counting for plugins. This is used to fix a double stop for input plugins that are reused. This problem was reported by Salih Gonullu <sag@open.ch>: http://marc.info/?l=netfilter&m=129439584700693&w=2 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: propagate global CFLAGSJan Engelhardt2010-11-051-0/+1
| | | | | | | | | We must not override CFLAGS, because that will break when the user overrides CFLAGS again at make time (which he is entitled to). So, name our CFLAGS regular_CFLAGS, and also include that across all Makefiles so that they are actually uesd for all the code. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* build: remove unused $(all_includes)Jan Engelhardt2010-11-051-1/+1
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* fix wrong list addition in plugin re-use logicPablo Neira Ayuso2010-06-171-1/+1
| | | | | | | | | | This patch fixes a bug that makes ulogd loops forever while propagating inputs to the output plugin. It is reproducible if you re-use three or more plugin instances. The problem is that the parameters in the list addition are in incorrect order. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* fix incorrect negative EINTR checking in main loopPablo Neira Ayuso2010-06-131-1/+1
| | | | | | | | | This patch fixes the following error that is displayed if we send SIGHUP to reopen the logfile: ulogd.c:904 select says Interrupted system call Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* NFCT: use new hashtable implementation for better performancePablo Neira Ayuso2010-01-171-110/+58
| | | | | | | | This patch replaces the existing hashtable implementation with a newer that provide better performance since it reduces the number of hash computations. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* build: remove -lpthread from MakefilePablo Neira Ayuso2009-07-221-1/+1
| | | | | | | This patch remove -lpthread that was introduced time ago to workaround a problem in gdb. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* ulogd: configure all plugins before resolving keys.Pierre Chifflier2009-04-171-7/+13
| | | | | | | | | | Split the 'resolve keys' step in two parts: first call the configure fonction for all plugins (in reverse order), then loop again to resolve the keys. This allows dynamic construction of the input and output keys, even for filter plugins. Signed-off-by: Pierre Chifflier <chifflier@inl.fr>
* Display which keys are optional in info mode.Eric Leblond2009-01-271-1/+6
| | | | | This patch adds a "optional" keyword to description of input key which are optional when --info is used to dump information about a plugin.
* Update .gitignore and remove install-shJan Engelhardt2009-01-201-0/+1
| | | | | | install-sh is autogenerated. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* Display logfile to check in case of error.Eric Leblond2009-01-131-2/+7
| | | | | This patch adds the display of the used logging file to look at if there is a critical error.
* Add valgrind compilation option.Eric Leblond2008-12-091-0/+4
| | | | | | Valgrind messages are obscur when the plugins are unloaded. This patch adds a macro that can be used to desactivate unloading. To use it, you have to specify 'CPPFLAGS=-DDEBUG_VALGRIND' on configure line.
* Free stacks when exiting.Eric Leblond2008-12-091-0/+12
| | | | This patch modifies ulogd2 to have it free the stacks when leaving.
* Introduce config_stop() functionEric Leblond2008-12-092-0/+6
| | | | | This patch adds the config_stop function which is in charge of releasing ressources allocated for configuration file parsing.
* Unload plugins when quitting.Eric Leblond2008-12-091-1/+20
| | | | | This patch adds unloading of plugins (call dlclose()) in ulogd2. This make valgrind happy and will be useful for daemon live reconfiguration.
* Add SIGINT to list of terminal signal.Eric Leblond2008-12-091-1/+2
| | | | | This patch modifies ulogd to intercept SIGINT signal and quit nicely when this signal is received.
* Call pluginstance stop function when exitingEric Leblond2008-12-091-1/+25
| | | | | | The stop function of plugin was not called when ulogd2 was preparing to quit. This patch adds a call to stop for all plugins in each stack and free pluginstance.
* Fix stop function of NFCT plugin.Eric Leblond2008-12-091-2/+4
| | | | | This patch fixes some crashes in NFCT plugin that were triggered by the call of the destructor_nfct function (during stop).
* Treat nice function return.Eric Leblond2008-12-091-1/+7
| | | | | gcc was warning that the return of the nice function should be treated. This patch adds an error message in case of failure.
* Link ulogd2 with libpthreadPierre Chifflier2008-12-091-1/+1
| | | | | | | | Explicitly link with libpthread. This allows to run ulogd within gdb, else it fails with message: Cannot find new threads: generic error Signed-off-by: Pierre Chifflier <chifflier@inl.fr> Signed-off-by: Eric Leblond <eric@inl.fr>
* cleanup: fix inappropriate initializations in ulogd.cEric Leblond2008-07-311-2/+1
| | | | | | | This patch fixes some improper initialization in ulogd.c. Signed-off-by: Eric Leblond <eric@inl.fr> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* cleanup: fix compilation warning related to signed and unsigned comparisonsEric Leblond2008-07-312-7/+7
| | | | | | This patch fixes the warning related to signed and unsigned comparaison. Signed-off-by: Eric Leblond <eric@inl.fr>
* cleanup: fix gcc warningsEric Leblond2008-07-291-2/+1
| | | | | | | | | This patch fixes some gcc warnings: * Unused variables * Functions with wrong return (or without return) Signed-off-by: Eric Leblond <eric@inl.fr> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Fix hexadecimal parsing in config fileEric Leblond2008-06-121-1/+1
| | | | | | | | The config file parsing was not able to parse integer given in hex notation. This patch modify the parsing of configfile to be able to use different integers notation. Signed-off-by: Eric Leblond <eric@inl.fr>
* Fix the propagation through the stackEric Leblond2008-06-121-0/+6
| | | | | | | | | When a plugin returns ULOGD_IRET_STOP, the propagation should stop. This was not the case as break was used to do so but it was called inside a switch and thus apply to the switch instruction and not to the llist iteration. Signed-off-by: Eric Leblond <eric@inl.fr>
* fix crash when SIGHUP is received.Hugo Mildenberger2008-06-061-8/+18
| | | | crash due to ulogd_logfile set to a string allocated on stack by config_parse_file
* rework NFCT to use a generic hashtablePablo Neira Ayuso2008-06-022-1/+194
| | | | | | | | This patch introduces a generic hashtable to store the nf_conntrack objects. The objects are identified by the original and reply tuples instead of the conntrack ID which is not dumped in the event message of linux kernel < 2.6.25. This patch also fixes the NFCT_MSG_* by NFCT_T_* which is the appropriate message type tag.
* [ULOGD PATCH] Fix multiple usage of DB output plugin./C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net2008-04-211-7/+11
| | | | | | | | | Due to the modifications done to be able to use multiple time the SOURCE plugin, a single instance of database output plugin could not anymore be used in separate stack. This patch fixes this by limiting the effect of the previous modification on SOURCE plugin. Signed-off-by: Eric Leblond <eric@inl.fr>
* This patch fixes a typo in an error message./C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org2008-04-051-1/+1
| | | | Signed-off-by: Eric Leblond <eric@inl.fr>