pdbtool: If a test message has no program attribute, warn when verbose

When encountering a test message that has no program attribute, warn
about it when verbose mode is on. The rationale for only doing it in
verbose mode is that there are valid reasons for having no program
attribute for a test (to temporarily disable it, for example), and we
don't want to needlessly spew a lot of warnings at the user.

Reported-by: Fabien Wernli <bugzilla.balabit@faxm0dem.org>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
logmsg: forget the stored MSGHDR value in case PID is set

When a message comes in, syslog-ng automatically stores the MSGHDR as it
looked like initially in order to be able to reproduce the message
in its original form.

The syslog-ng parser sometimes skips spaces, so otherwise the reproduced
message might somewhat be different.

However, if the nvpairs that make up $MSGHDR are changed, this behaviour
is quite unintuitive, resulting the changes to be ignored in the MSGHDR.

This patch adds a similar treatment to the PID nvpair as was already
present for PROGRAM.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afsocket: Restore localport() support for network destinations

A while ago, the functionality to set the local, originating ports of
network destinations has been lost. This patch restores that
functionality by setting the port on the socket address when it is being
set up.

Reported-by: Sebastiaan Hoogeveen <zebaz@xs4all.nl>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>