loggen: add --permanent (-T) parameter to send logs indefinitely
docs: add loggen's --permanent option to documentation
Merge pull request #285 from ihrwein/3.6/master

loggen: add --permanent (-T) parameter to send logs indefinitely
tlscontext: Make hostname check in tls certificate case insensitive
tlscontext: do not accept certificate which is not contained by the list of fingerprints

Signed-off-by: Juhász Viktor <jviktor@balabit.hu>
Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
Merge pull request #293 from lbudai/3.6/tlscontext-fix

3.6/tlscontext fix
afsmtp: linkage order fixed

Suggested-by: Michael Sterrett <mr_bones_@gentoo.org>
Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
Merge pull request #295 from lbudai/3.6/master

afsmtp: linkage order fixed
scl/scl.conf: Use a wildcard to include SCL snippets

To be able to install SCL snippets to be included by default, without
modifying scl.conf itself, use a wildcard-include. This allows
distributions to ship some of the SCLs in different packages, without
breaking the default config, or having to enable them in other ways.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Merge pull request #296 from algernon/f/scl/wildcard-include

scl/scl.conf: Use a wildcard to include SCL snippets
afsql: trying to do a better transaction handling

Two problems with transactions:
 * mixing DDL and DML statements in a single transaction
   (create/update table)
 * simple select can abort a transaction
   (checking if a table exists or not)

syslog-ng checks whether a table exists or not by 'select * from table'
(and get structure of the table as a side-effect...)

There are some DB-providers which abort current transaction when try to
select from a non-existing table (eg.:mssql).

libdbi provides a better, db-provider specific way to checking table existance
(this is a meta-query which always succeed).
Unfortunately, this function is buggy in pgsql driver, so we had to do
something else).

syslog-ng asks db only when the name of the table to be checked is not seen
before (this is based on a runtime information: every table is validated and
name of all validated tables are stored in a hashtable).

When the table not found in the list of validated tables:
 - active transaction is commited (if exists)
 - new transaction is started for checking if the table exists or not
    - if the table exists, its structure is updated according to the
      structure given in the config file
    - otherwise a new table is created

Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
afsql: validate_table() refactored

 afsql_dd_sql_identifier_sanitize()     ->  _sanitize_sql_identifier()
 _table_is_exist()                      ->  _is_table_present()
 afsql_dd_sql_identifier_is_sanitized() ->  _is_sql_identifier_sanitized()
 `validate table`                       ->  `syslog conform table`

Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
Merge pull request #292 from lbudai/3.6/f/afsql-transaction-fixes

3.6/f/afsql transaction fixes
afsocket: fix for platforms which not support credential passing

Fixes #298

Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
Merge pull request #303 from lbudai/3.6/fix-credential-passing

afsocket: fix for platforms which not support credential passing
timeutils: fix bad pointer cast that leads to timestamp overwriting

In `log_msg_parse_date()` the variable `now` is of type `GTimeVal`.
Its member `tv_sec` is of type `long`, and its address was cast to a `time_t`
pointer.
This led bad argument passing to the `cached_localtime()` function.

Fixes: #304

Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
Merge pull request #305 from lbudai/3.6/master

timeutils: fix bad pointer cast that leads to timestamp overwriting
afsocket: rename log_transport_unix_socket_new to _dgram_socket_new()

When doing the LogTransport refactor in early 3.6 days, one difference
between unix-dgram() and unix-stream() were not taken into consideration:
zero-length packets should only be ignored for SOCK_DGRAM transports and
not for SOCK_STREAM ones.

This is a preparatory patch to fix the issue this bug causes, it renames
the original constructor function to log_transport_unix_dgram_socket_new()
by adding the _dgram_ qualifier, otherwise it doesn't change functionality.

The fix is coming in a subsequent patch.

Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
afsocket: add log_transport_unix_stream_socket_new() function

This patch adds a SOCK_STREAM specific AF_UNIX socket transport
implementation.

Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
afsocket: fix spinning on EOF for unix-stream() sockets

Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>