1487 Commits

Author SHA1 Message Date
Rainer Gerhards
502759aea0
core: emit TZ warning on startup not on Linux non-container
On Linux it seems common that the TZ variable is NOT properly set.
There are some concerns that the warning related to rsyslog correcting
this confuses users. It also seems that the corrective action rsyslog
takes is right, and so there is no hard need to inform users on that.
In Linux containers, however, the warning seems to be useful as the
timezone setup there seems to be frequently-enough different and
rsyslog's corrective action may not be correct.

So we now check if we are running under Linux and not within a container.
If so, we do not emit the warning. In all other case, we do. This is
based on the assumption that other unixoid systems still should have
TZ properly set.

closes https://github.com/rsyslog/rsyslog/issues/2994
2018-09-17 08:56:09 +02:00
Rainer Gerhards
d4464e2950
Merge pull request #3001 from rgerhards/i2997
AIX: HUP not processed when running as non-service
2018-09-07 16:24:34 +02:00
Rainer Gerhards
31d58a2eee AIX: HUP not processed when running as non-service
When rsyslog is not run as a service (under SRC control), HUP does not
awake the main loop timeout. In theory, it should do so, but in practice
this does not happen. As a work-around we now implement a kind of
ressource-saving busy waiting where we awake every half second to check
if HUP (or something else noteworthy) happened. This should not cause
any real issue in any case, because running rsyslog as a non-service
is very uncommon and probably only happens during testbench runs.

closes https://github.com/rsyslog/rsyslog/issues/2997
2018-09-07 03:25:38 -05:00
Rainer Gerhards
ef6d877540 fix build error e.g. on FreeBSD
regression form 9c0f2d4066b7d5a393f2f5acd080caa4dc4c1144
2018-09-07 10:24:49 +02:00
Rainer Gerhards
d98f1cbb9d AIX: some more rsyslog core symbols need to be exported
seen while working on testbench. Unfortunately, we seem to be unable
to automatically export all global symbols, which is what we really
need.
2018-09-06 11:03:04 -05:00
Rainer Gerhards
9c0f2d4066 build system: fix platform linker options detection
most importantly, it did not work for AIX, which resulted in problems
starting up rsyslog
2018-09-06 03:37:15 -05:00
Rainer Gerhards
0ce02e4a71
omfwd: remove invalid error message
The config plumbing itself provides an error message. The one given here
was also totally wrong ;-)

Thanks to Frank Bicknell for spotting this message and making me alert.
2018-09-04 12:35:11 +02:00
Rainer Gerhards
3ae8dfdd67
Merge pull request #2977 from fbicknel/fbicknel/fix_dynafile_error_message
WiP: Fix errant error message when dynafile param needed
2018-09-04 12:26:46 +02:00
Frank Bicknell
d3edc4eb71 Fix errant error message when dynafile param needed
Per issue 2975
2018-08-31 13:04:32 -04:00
Rainer Gerhards
97800407aa AIX: make rsyslog export basic symbols correctly
the AIX dynamic linker needs some help in understanding which
symbols can be dyanamically linked at runtime
2018-08-31 09:06:40 -05:00
Rainer Gerhards
6efae3c2fd fix compile warnings under AIX
see also https://github.com/rsyslog/rsyslog/issues/2971
2018-08-31 05:14:01 -05:00
PascalWithopf
c83e3ed216 correct codestyle in rsyslog part 2 2018-08-01 16:11:33 +02:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Rainer Gerhards
fff09ac94d
core: replace errmsg object calling conventions
old interface still needs to be removed to fully finish
refactoring of this component.

see also https://github.com/rsyslog/rsyslog/issues/1684
2018-07-21 17:47:29 +02:00
Rainer Gerhards
56ace5e418 omusrmsg: replace non-string operations by memory copies
Using str...() family of functions is unsafe on objects not declared
to be strings. This was pretty old code. Gcc 8 warnings brought up
the problem. So it looks there were no problem in practice (as it work
for ~30 years).
2018-07-16 14:41:29 +02:00
Rainer Gerhards
b90f9dba1f omusrmsg: do not fall back to max username length of 8
This happens if utmp.h and friends are not available and stems back to
the original syslogd. Nowadas, 32 is more appropriate and now being used
in that (now very unlikely) case. The detection logic for UT_NAMESIZE has
also been streamlined.

closes https://github.com/rsyslog/rsyslog/issues/2834
2018-07-13 18:07:47 +02:00
Denis Ovsienko
1761769074 spell HTML in uppercase in the man pages 2018-07-06 18:20:32 +01:00
Denis Ovsienko
919e2d0ad4 fix a typo in the rsyslog.conf man page 2018-07-06 16:10:21 +01:00
Rainer Gerhards
99a339eb3e
Merge pull request #2811 from rgerhards/lgtm2
Lgtm2
2018-07-02 20:48:03 +02:00
Rainer Gerhards
95468d009b
silence some static analyzer warnings (hopefully)
especially in the debug case there is simply no other chance
than to ignore the error...
2018-07-02 13:35:26 +02:00
Rainer Gerhards
2656afd4f5
build system: do not disable testbench tests via --disable-liblogging-stdlog 2018-07-02 11:13:05 +02:00
Rainer Gerhards
8f8ed81e5e
add global directive "abortOnUncleanConfig"
This provides a new-style alternative to $AbortOnUncleanConfig.
Note that a testbench test was changed to the new syntax. Adding
an additional test did not look useful, as the testbench still
sufficiently tests old and new method.

closes https://github.com/rsyslog/rsyslog/issues/2744
2018-06-27 11:17:48 +02:00
Rainer Gerhards
c25de346d6
Merge pull request #2707 from rgerhards/i2705
build system: do not use liblogging-stdlog dependency by default
2018-05-16 17:52:34 +02:00
Rainer Gerhards
0091c7d6e9 build system: do not use liblogging-stdlog dependency by default
Liblogging-stdlog was introduced to provide a broader ability to send rsyslog
internal logs to different sources. However, most distros did not pick up
that capability and so instead we do a regular syslog() call. We assume that
the actual functionality is never used in practice, so we plan to retire it.
That makes building rsyslog from source easier.

The plan is to disable use of liblogging-stdlog by default during
configure. So users (and distros!) can still opt-in to have it enabled if
they desire.

A couple of releases later, we want to completely remove the functionality,
except if there has desire been shown in the meantime which justifies to keep
liblogging-stdlog.

This patch is for disabling liblogging-stdlog by default. We now also
emit a warning message ("liblogging-stdlog will go away") so that users
know what is going on and my react.

closes https://github.com/rsyslog/rsyslog/issues/2705
see also https://github.com/rsyslog/rsyslog/issues/2706
2018-05-14 12:50:19 +02:00
Rainer Gerhards
90308823df core: consistent handling of oversize input messages
In the community we frequently discuss handling of oversize messages.
David Lang rightfully suggested to create a central capability inside
rsyslog core to handle them.

We need to make a distinction between input and output messages. Also,
input messages frequently need to have some size restrictions done at
a lower layer (e.g. protocol layer) for security reasons. Nevertheless,
we should have a central capability

* for cases where it need not be handled at a lower level
* as a safeguard when a module invalidly emits it (imfile is an example,
  see https://github.com/rsyslog/rsyslog/pull/2632 for a try to fix it
  on the module level - we will replace that with the new capability
  described here).

The central capability works on message submission, and so cannot be
circumvented. It has these capabilities:

* overisze message handling modes:
  - truncate message
  - split message
    this is of questionable use, but also often requested. In that mode,
    the oversize message content is split into multiple messages. Usually,
    this ends up with message segments where all but the first is lost
    anyhow as the regular filter rules do not match the other fragments.
    As it is requested, we still implemented it.
  - accept message as is, even if oversize
    This may be required for some cases. Most importantly, it makes
    quite some sense when writing messages to file, where oversize
    does not matter (accept from a DoS PoV).
* report message to a special "oversize message log file" (not via the
  regular engine, as that would obviously cause another oversize message)

This commit, as the title says, handles oversize INPUT messages.

see also https://github.com/rsyslog/rsyslog/issues/2190
closes https://github.com/rsyslog/rsyslog/issues/2681
closes https://github.com/rsyslog/rsyslog/issues/498

Note: this commit adds global parameters:
 * "oversizemsg.errorfile",
   is used to specify the location of the oversize message log file.
 * "oversizemsg.report",
   is used to control if an error shall be reported when an oversize
   message is seen. The default it "on".
 * add global parameter "oversizemsg.input.mode"
   is used to specify the mode with which oversized messages will
   be handled.
2018-05-14 11:24:20 +02:00
Jan Gerhards
4d122687e8 ompipe: use new errmsg interface
see also https://github.com/rsyslog/rsyslog/issues/1684
2018-05-08 14:45:53 +02:00
Rainer Gerhards
84980e2883 omfwd: fix memory leak in never-released code
This is a regression from
https://github.com/rsyslog/rsyslog/commit/2bd0fb282df92962a9817b

PR https://github.com/rsyslog/rsyslog/pull/2651 introduced that commit.

Note: that commit was merged 17 days ago and is not part of any offically
released version.

Detected by Coverity Scan, CID 190071, 190072.
2018-05-04 10:05:28 +02:00
Rainer Gerhards
bd6f016db0 add global option internal.developeronly.options
This permits the ability to set some developer-specific behaviour
changes, e.g. for testbench testing or things like this. NEVER to
be used by users.
2018-04-28 12:46:32 +02:00
Rainer Gerhards
09e3d06c11 bugfix: rsyslog aborts on startup when specific config errors are made
The following errors must be made in rsyslog.conf:
* no action present
* a call statement is used on an undefined ruleset

In this case, rsyslog emits an error message on the missing actions and
then segfaults. Depending on memory layout, it may also continue to run
but do nothing except accepting messages as no action is configured.

This patch make rsyslog properly terminate after the error message. It
is a change in behavior, but there really is no reason why a defunct
instance should be kept running.

closes https://github.com/rsyslog/rsyslog/issues/2399
2018-04-28 12:00:34 +02:00
Rainer Gerhards
f0c89d0e13
Merge pull request #2651 from mikebcom/feature
omfwd: add support for bind-to-address for UDP
2018-04-27 08:58:06 +02:00
Rainer Gerhards
8eead67caf
Merge pull request #2648 from jgerhards/errmsg-omshell
omshell: use new errmsg interface
2018-04-26 18:43:57 +02:00
Mike Manning
2bd0fb282d omfwd: add support for bind-to-address for UDP
To allow the same source address to be used regardless of the egress
interface taken, an option is added for an address to bind the datagram
socket to. Similarly to imudp, it is necessary to add an ipfreebind
option which is set by default, so as to avoid an excess of errors at
startup before the network interface has come up. This enhancement
allows a usecase on networking devices, by which a source interface
that is typically a loopback is specified, on which an address to bind
to is configured. This is so that the same source address is used for
all packets from rsyslog. Support for the TCP case can be added later.

Signed-off-by: Mike Manning <mmanning@att.com>
2018-04-20 07:50:58 +01:00
Rainer Gerhards
26d3fd0ef9
Merge pull request #2465 from CodeHarsh/master
adding hash64 and hash64mod functions support in rainerscript
2018-04-17 15:29:09 +02:00
Jan Gerhards
7043f6da51 rsyslogd: use new errmsg interface
see also https://github.com/rsyslog/rsyslog/issues/1684
2018-04-17 12:56:27 +02:00
Jan Gerhards
2100326e43 omshell: use new errmsg interface
see also https://github.com/rsyslog/rsyslog/issues/1684
2018-04-16 19:22:16 +02:00
Rainer Gerhards
1dead064dc
Merge pull request #2622 from rgerhards/all-warnings
QA: re-enable some compiler warnigs AX_COMPILER_FLAGS disables
2018-04-13 17:44:53 +02:00
Jan Gerhards
ebfc1de77b omusrmsg: use new errmsg interface
see also https://github.com/rsyslog/rsyslog/issues/1684
2018-04-13 12:00:32 +02:00
Rainer Gerhards
48c397374d fix some __attribute__((unused)) and add missing ones
as it looks, some compiler versions (e.g. gcc 7) seem to be rather
picky on the position where this attribute is applied. So this
commit moves them to the position where they are properly detected.

We also add missing attributes. Some are missing due to conditional
compilation what we did not detect in our regular development
environments. This now comes up as we have enabled the corresponding
warning globally, and so they now also show up on those platforms.
2018-04-10 14:44:58 +02:00
Rainer Gerhards
a010fc1229
Merge pull request #2609 from rgerhards/i2417
omfile bugfix: segfault when empty filename is given
2018-04-04 08:36:45 +02:00
Rainer Gerhards
3d7acd2656 omfile bugfix: segfault when empty filename is given
closes https://github.com/rsyslog/rsyslog/issues/2417
2018-04-03 12:26:52 +02:00
Rainer Gerhards
c7711fbb07 omfile: fix non 100% correct preprocessor directives
can be considered cosmetic, but we really want a clean compile
2018-04-01 18:13:51 +02:00
Harshvardhan Shrivastava
17738f25a8 Merge remote-tracking branch 'upstream/master' 2018-03-27 14:11:02 +05:30
Harshvardhan Shrivastava
c9720547d9 merge master 2018-03-27 14:10:50 +05:30
Rainer Gerhards
1ea4bb2c42 fix build issues on Solaris with gcc 2018-03-18 11:07:16 +01:00
Rainer Gerhards
641912e9d3 tools/logctl: replace unsafe function
detected by lgtm static analyzer
2018-03-17 17:56:14 +01:00
Rainer Gerhards
ed1813dcb6
Merge pull request #2545 from hrak/master
omfile: Fix wrong order of arguments for errmsg
2018-03-17 12:37:21 +01:00
Rainer Gerhards
db7b8f07c1 remove dead code
Expression is actually constant under given code. To be on the safe
side for future code changes, I put in a guard assert().

detected by lgtm.com static analyzer
2018-03-16 18:58:11 +01:00
Hans Rakers
b617456a48 Fix wrong order of arguments for errmsg 2018-03-15 10:49:56 +01:00
Harshvardhan Shrivastava
ade17f9259 adding hash64 and hash64mod functions support in rainerscript
removing logmsg

fixing typo in Makefile.am

fixing typo

making default hash static

fixing cast issue

fixing test
2018-02-08 20:09:52 +05:30
Bruno Bigras
cde7b23dd5
Fix typo rsyslogd.8 2018-02-06 11:48:59 -05:00