system-source: Use /dev/log on HP-UX

Using /dev/pipe on HP-UX was a mistake, use /dev/log instead, as the
original shell script did.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afstreams: Fix the CPPFLAGS for the module

It should look for files under both ${top_srcdir} and ${top_builddir},
not twice at the same place.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afstreams: Migrate to new, working APIs

The afstreams module has been broken for more than a year, this patch
brings it back from the dead by migrating it to newer APIs and all.

Based on a patch by Balazs Scheidler <bazsi@balabit.hu>.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
system-source: Fix the uname() call on Solaris

On Solaris, uname() can return any positive value, and that indicates
success. Pretty much everywhere else, only 0 does. Thankfully, -1
signals failure everywhere, so check for that.

This makes system() work on Solaris again.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
affile: fixed a pipe permission problem

When syslog-ng creates a pipe, create it with user-specified permissions
or restrictive ones (0600) by default, instead of creating it with broad
read-write permissions (0666) and patching it up later.

Signed-off-by: Budai Laszlo <lbudai@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
gprocess: setsid() does not depend on isatty()

On HPUX, during boot the console does not considered as a tty, so syslog-ng does not
call setsid, the tty is not detached and the supervisor is killed at the end of the boot.
setsid() does not and should not depend on isatty(), and anyways setsid() is considered
more unix way than ioctl().

Signed-off-by: Juhasz Viktor <jviktor@balabit.hu>
Signed-off-by: Viktor Tusa <tusa@balabit.hu>
logqueue-fifo: use after free in function log_queue_fifo_ack_backlog

Signed-off-by: Daniel Gados <gdani@balabit.hu>
persist-state: fix memory leak in persist_state_rename_entry

The old key was leaked when renaming a persist-state key. This patch fixes
that leak.

Signed-off-by: Juhasz Viktor <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
persist-state: free the SerializeArchive used for loading the state in persist_state_load_v4

Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
stats: fix a failing assertion when stats_level() is changed

When stats-level() is changed and syslog-ng is reloaded, an assertion failed
in the facility counters unregistration. The reason was that
the unregistration used the 'other' category instead of the one assigned
to the given facility code.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
.travis.yml: Update for the new branch structure

Update the Travis-CI control file for the new branch structure.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afuser: remove alarm workaround

The Linux kernel used to have a bug that caused the afuser driver
to block even if O_NONBLOCK is set in the open flags. It was fixed
a long time ago, and alarm() is incompatible with multithreaded programs,
thus get rid off the alarm() call to detect blocked ttys.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
README.md: add new file to describe syslog-ng

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
README.md: Various improvements

Rearrange the README a little bit, putting the source installation docs
at the top, adding more links, and rewording a few things here and
there.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Makefile.am: Use the -no-install libtool flag for tests

When building test programs (anything in ${check_PROGRAMS}) add
-no-install to the list of LDFLAGS, so that libtool stops generating a
useless wrapper for them. This makes debugging the check programs
easier, and also avoids a lot of shell launching for no good reason.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>