1442 Commits

Author SHA1 Message Date
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
Bruno Bigras
cde7b23dd5
Fix typo rsyslogd.8 2018-02-06 11:48:59 -05:00
Rainer Gerhards
6daf835cd0 fix build warnings on alpine linux
Alpine compiles with size optimization, and then the compiler
finds a couple of inline functions that are really not worth it.
2018-01-26 17:26:44 +01:00
Rainer Gerhards
d8b4e78e18 cleanup: remove forgotten debug message 2018-01-21 12:22:06 +01:00
Rainer Gerhards
d01ea7e2eb core: set TZ on startup if not already set
In theory, TZ should be set by the OS. Unfortuantely, this seems
to be not the case any longer on many Linux distros. We now check
it and set it appropriate if not already given.

closes https://github.com/rsyslog/rsyslog/issues/2054
2018-01-19 10:29:56 +01:00
Rainer Gerhards
d4c6c5f468
Merge pull request #2377 from rgerhards/container-no-pidfile
core: do not write pid file by default if running as pid 1
2018-01-14 16:52:20 +01:00
Rainer Gerhards
d7aea382fa fix build warning on Alpine Linux
due to old-style header names -- now using the new ones, which are also
supported on the other platforms.
2018-01-12 13:15:55 +01:00
Rainer Gerhards
7e6d28a414 core: do not write pid file by default if running as pid 1
This means we run inside a container and writing pid files is unnecessary
and bad practice in this case.
2018-01-11 15:38:45 +01:00
Rainer Gerhards
f557211f94 core: detect if runing in container, enable ctl-c if so
This also sets the basis for other container-specific config changes
and other optimizations.

closes https://github.com/rsyslog/rsyslog/issues/2371
2018-01-10 13:05:34 +01:00
Rainer Gerhards
b9cac88204 add global config setting shutdown.enable.ctl-c to enable ctl-c
It can be useful to ctl-c out of rsyslog, even if it is started via
-n, especially inside containers.  The new config setting permits
to enable this capability.

closes https://github.com/rsyslog/rsyslog/issues/533
2018-01-08 18:10:47 +01:00
Rainer Gerhards
0dcfb870a5 core: pidfile was not deleted upon shutdown
this is a regeresson from recent commit 159b37afc881, bug was never
released
2018-01-02 09:02:13 +01:00
Rainer Gerhards
159b37afc8 rsyslogd: add capability to specify that no pid file shall be written
Command line option -iNONE provides this capability. This utilizes the
pre-existing -i option, but uses the special name "NONE" to turn of the
pid file check feature. Turning off is useful for systems where this no
longer is needed (e.g. systemd based).

closes https://github.com/rsyslog/rsyslog/issues/2143
2017-12-28 17:40:51 +01:00
PascalWithopf
29c9fb1f9a codestyle: reduce line length to 120
lines are still checked for a length of 125 because
these are just some of the lines
2017-12-21 17:09:32 +01:00
Rainer Gerhards
049d750079
Merge pull request #2279 from PascalWithopf/line_length_correction
codestyle: reduce max line length to 125
2017-12-21 11:39:17 +01:00
PascalWithopf
79de51e4fc codestyle: reduce max line length to 125 2017-12-20 16:16:57 +01:00
Rainer Gerhards
5b694ee96b logctl usertool: add some pragmas to work-around libbson problem 2017-12-20 15:53:15 +01:00
Rainer Gerhards
e8627a4ec5 remove obsolete pre-KSI GuardTime signature interface
this is no longer functional starting Jan 2018 as it
reached end of life.

closes https://github.com/rsyslog/rsyslog/issues/2128
2017-12-19 09:42:44 +01:00
Rainer Gerhards
bf789ab048 fix build issue on BSD (based on original BSD patch) 2017-12-18 13:26:37 +01:00
BSD Patch
9857b75c04 syslogd: import BSD project patches 2017-12-18 13:25:15 +01:00
Rainer Gerhards
e1758bf32c omfile: add module-global option "dynafile.donotsuspend"
this permits to enable SUSPENDing dynafile actions. Traditionally,
SUSPEND mode was never entered for dynafiles as it would have blocked
overall processing flow. Default is not to suspend (and thus block).

closes https://github.com/rsyslog/rsyslog/issues/2236
2017-12-16 18:32:58 +01:00
Rainer Gerhards
69661aac90 debug system: output global and imrelp (listener) max message size
Can be useful during debugging.

closes https://github.com/rsyslog/rsyslog/issues/2215
2017-12-14 18:37:30 +01:00
Rainer Gerhards
967f9de2eb
Merge pull request #2221 from rgerhards/cid-186292
pmrfc3164: fix invalid whitespace-skip
2017-12-14 17:17:47 +01:00
Rainer Gerhards
d8528315ab pmrfc3164: fix invalid whitespace-skip
regression from yesterday's commit, deteced by Coverity Scan,
CID 186292
2017-12-14 12:54:17 +01:00
Rainer Gerhards
ffa7d48fa2 Merge branch 'issue_2098' of https://github.com/HugoSoszynski/rsyslog into libbson-bug 2017-12-14 12:38:44 +01:00
Rainer Gerhards
5ca051bc92 work-around libbson compiler warning
this is fixed in newer versions of libbson, but we do not
want to force using the newer ones just because of this issue.
2017-12-13 15:54:44 +01:00
Rainer Gerhards
a9601ebaec pmrfc3164: try to detected headerless message
headerless is indicated by whitespace followed by either '{' or '['.
This follows the trend to send JSON messages via syslog without any
header. We use default header values in this case.

This right now is a bit experimental; we may roll it back if
problems show up in practice.

closes https://github.com/rsyslog/rsyslog/issues/2030
2017-12-12 18:25:16 +01:00
Hugo Soszynski
078b5e5daa Merge branch 'master' of github.com:rsyslog/rsyslog into dev 2017-12-12 17:41:47 +01:00
Rainer Gerhards
444c30ff05 "fix" Coverity scan CID 185431 2017-12-10 15:07:11 +01:00
Rainer Gerhards
7361603175 refactor core to unify random number generation
this is a step forward, but not everything yet done. Nevertheless
useful in itself.
2017-12-06 13:58:58 +01:00
Rainer Gerhards
58ff19b2f5 add info if compiled with libsystemd to rsyslogd -v output 2017-11-30 10:07:46 +01:00
Rainer Gerhards
c3b48d708a iminternal: refactor to fix cosmetic Coverity scan CID 185435 2017-11-30 08:19:14 +01:00
Rainer Gerhards
56014d3fe4 "fix" Coverity scan false positives 2017-11-30 08:19:14 +01:00
Hugo Soszynski
e2809d65ec Made the logctl usertool ISO C90 compliant.
Made the logctl usertool use a homogeneous coding style based on the most used practices in the file.
2017-11-24 23:38:06 +01:00
Rainer Gerhards
0fe2de8f24
Merge pull request #1917 from jjourdin/master
Improvement on ommongodb: mongo-c-driver with TLS and replicaset
2017-11-23 15:31:48 +01:00
Hugo SOSZYNSKI
621153ddab Updated the Copyrights of the modified files. 2017-11-23 14:12:38 +01:00
Hugo SOSZYNSKI
1d55cad041 Made the funtions static hopping to correct the "no previous prototype" problème and suppresion of trailing spaces 2017-11-23 11:38:10 +01:00
Rainer Gerhards
a82bb9cb2d "fix" Coverity scan false positives 2017-11-23 09:15:56 +01:00
Rainer Gerhards
acb62dfdab remove systemd embedded code, use library instead
Since the early days rsyslog uses the orginal systemd embedded
interface code. This commit changes it to libsystemd where available.
If we do not find libsystemd, we assume the system does not use
systemd, which is a safe assumption nowadays. This ensures we use the
fresh interface code and also removes bloat from our project.

closes https://github.com/rsyslog/rsyslog/issues/1933
2017-11-21 09:12:39 +01:00
Hugo SOSZYNSKI
1a9fe3a3fc Added __attribute__((unused)) in logctl usertool to silence warning that occurs with use of mongo-c-driver >= 1.5.0. This is needed because stable versions of Debian based distributions uses mongo-c-driver <= 1.4.2. 2017-11-17 16:43:51 +01:00
Hugo SOSZYNSKI
85a4f9d589 Added compilation time mongo-c-driver version check to not use deprecated mongoc function when newer are available in the logctl usertool. 2017-11-17 16:29:30 +01:00
Hugo SOSZYNSKI
1ab4bfb0e7 Corrected some compilation warning and errors.
No longer installing libmongo-client in Travis script.
2017-11-17 15:37:26 +01:00
Hugo SOSZYNSKI
60ac93f939 Updated the usertool logctl to use mongo-c-drvier instead of mongo-client. 2017-11-17 15:23:08 +01:00
PascalWithopf
e485c5c5bc codestyle: shorten lines to max 130 chars 2017-11-15 09:04:42 +01:00
Rainer Gerhards
af7b02b350 rscryutil bugfix: decryption error potentially undetected
Detectec by Coverity scan, CID 185340
2017-11-13 18:51:15 +01:00
Rainer Gerhards
b57db5ce3c ratelimiting: data race in Linux-like ratelimiter
access to the Linux-like ratelimiter was not properly synchronized, and
the system rate-limiter was not using it in any case.

This could lead to the rate-limit settings not being properly
respected, but no "hard error".
2017-11-10 19:03:09 +01:00
Rainer Gerhards
744ae3c14c rscryutil: fix theoretical file handle leak
could only happen if file handle 0 was returned, what actuallyy
could not happen, as stdin is kept open by this command line tool.
Still fixing it to get rid of Coverity scan diagnostic.

Detected by Coverity scan, CID 185323
2017-10-30 14:31:48 +01:00
Rainer Gerhards
dff58ba6f3 remove no-longer needed code
detected by Coverity scan, CID 185346
2017-10-28 14:09:52 +02:00