52 Commits

Author SHA1 Message Date
Rainer Gerhards
8d807e35f0 mmexternal bugfix: potentially missing argv[0]
This is incorrect and can cause problems with some language, namely go.

see also https://github.com/rsyslog/rsyslog/issues/1858
closes https://github.com/rsyslog/rsyslog/issues/2278
2017-12-20 15:58:26 +01:00
Rainer Gerhards
b3fbedae2d core: refactor parent directory creation function
streamline code, also fix Coverity scan ID 185877
2017-12-08 16:16:20 +01:00
Rainer Gerhards
64669bd41e fix cancel cleanup handler in directory tree creation code
PR #2109 provides a solution for a race in directory creation (if a file
is to be written to a new path). There is a small weakness in that patch
in that it introduces a (very unlikely) potential hang condition during
shutdown.

see also https://github.com/rsyslog/rsyslog/pull/2109
2017-11-27 14:40:12 +01:00
Rainer Gerhards
1aadc71b26
Merge pull request #2109 from nipakoo/parent_dir_create_lock
error during config processing: omfile: creating parent directories for file  'File exists'
2017-11-26 17:39:21 +01:00
Jan Gerhards
bcc5c317a0 srutils: use better random function
random() is known to be weak. Therefore, using /dev/urandom
is better, but only available on Linux.

closes https://github.com/rsyslog/rsyslog/issues/1937
2017-11-25 18:16:16 +01:00
Niko Kortstrom
bb9d39d8d3 Implement locking for makeFileParentDirs(). While this does not help with a race
against other processes working on the same directories, the repeated clashes are
most likely to occur within our address space. Seen to lead to failure loops with
rsyslogd starting two threads which continuously fail here until the service is
restarted manually.
2017-11-25 12:51:10 +02:00
FX Coudert
a9a1dea2ab fix build problem on MacOS
closes https://github.com/rsyslog/rsyslog/issues/1485
2017-03-29 14:32:12 +02:00
Rainer Gerhards
efbd6f964a core: add error message if configured directory owner cannot be set
closes https://github.com/rsyslog/rsyslog/issues/1396
2017-02-08 15:24:34 +01:00
Rainer Gerhards
5dea315147 fix build problems on some versions of fedora 2016-12-23 09:33:35 +01:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Rainer Gerhards
4a578d3552 bugfix: theoretical queue file corruption when more than MAX_INT files
This also corrects some code areas that needed to be adapted to the
data type change done in the previous commit.

closes https://github.com/rsyslog/rsyslog/issues/1202
2016-10-18 15:48:15 +02:00
Rainer Gerhards
8a986092c6 fix old-style definitions (missing prototype in func def) 2016-06-03 10:08:57 +02:00
Rainer Gerhards
5e3b075d53 fix compiler warnings 2016-06-02 12:08:55 +02:00
Rainer Gerhards
8a8675b223 fix compiler warnings 2016-06-02 10:18:05 +02:00
Janmejay Singh
2be95ef067 fix dynstats stats-publish coordinated tests that were failing on 32-bit env because field width of long (32 bits) was too small to hold millisecond-resolution time 2016-05-09 19:43:22 +05:30
Janmejay Singh
a30bf638cc Trying to switch a stats-dependent test from timing based coordination to semaphore-based coordination. 2016-04-18 21:35:07 +05:30
Peter Portante
2470f0f72b Remove use of sizeof(char) and sizeof(uchar)
Remove the use sizeof(char) or sizeof(uchar) in calculations for memory
allocation or string length.  There are no known platforms for which
sizeof(char) or sizeof(uchar) is not 1, and c99 has defined sizeof(char)
to be 1 (section 6.5.3.4 of c99).
2015-12-16 02:18:45 +00:00
Tomas Heinrich
ce1e9f5f3e Fix race-condition detection in path-creation code
It appears the detection never actually worked due to wrong error
checking. errno needs to be checked to determin the reason for the
failure.
2015-07-18 22:05:28 +02:00
Rainer Gerhards
89a35632b9 Merge branch 'master-path-creation-race' of https://github.com/theinric/rsyslog into master-candidate 2015-07-14 11:08:19 +02:00
Tomas Heinrich
3acd3ea4f5 Fix race-condition detection in path-creation code
The affected code is used to detect a race condition in between
testing for the existence of a directory and creating it if it didn't
exist.  The variable tracking the number of attempts wasn't reset for
subsequent elements in the path, thus limiting the number of
reattempts to one per the whole path, instead of one per each path
element.
This solution was provided by Martin Poole.
2015-07-09 15:43:37 +02:00
Janmejay Singh
4db25fb98b rainerscript: function random(max) which returns a random value in [0, max) 2015-06-23 15:38:59 +05:30
Zach Lisinski
0977d6e1ec Added brace glob expansion to imfile wildcard 2015-04-10 12:24:13 -04:00
Douglas K. Rand
8e64a4b604 add BSD NTP facility 2014-12-03 12:46:31 +01:00
Rainer Gerhards
b11bf2745c Merge branch 'v7-stable-prifix' into v8-stable-prifix
WARNING: does not compile, will be fixed with next commit

Conflicts:
	configure.ac
	tools/rsyslogd.c
2014-09-16 14:59:14 +02:00
Rainer Gerhards
1ac20ffe97 Merge branch 'v5-stable-prifix' into v7-stable-prifix
Conflicts:
	plugins/imklog/imklog.c
	plugins/imtemplate/imtemplate.c
	plugins/imuxsock/imuxsock.c
	runtime/msg.c
	runtime/rsyslog.h
	runtime/rule.c
	runtime/syslogd-types.h
	tools/syslogd.c
2014-09-16 14:48:29 +02:00
Rainer Gerhards
df4e90f602 Merge branch 'v5.8.13-prifix' into v5-stable-prifix
Conflicts:
	plugins/imklog/imklog.c
	plugins/imklog/ksym.c
	runtime/rule.c
2014-09-16 12:43:29 +02:00
Rainer Gerhards
750824186d Merge branch 'v5.8.6-prifix' into v5.8.13-prifix 2014-09-15 17:22:59 +02:00
Rainer Gerhards
00a96dce17 add invld.* selector, fix problem with previous patch 2014-09-15 17:21:48 +02:00
Rainer Gerhards
4bcccb64fd refactor: another round of qualifiers... 2013-12-04 12:10:07 +01:00
Rainer Gerhards
e837b78f6a add BSD-specific syslog facilities
* "console"
* "bsd_security" - this is called "security" under BSD, but that name
  was unfortunately already taken by some standard facility. So I
2013-06-12 09:39:08 +02:00
Martin Carpenter
5e6ba49ef3 Fix for glob(3)s that lack GLOB_NOMAGIC
Conflicts:

	configure.ac
2013-03-21 16:03:46 +01:00
Rainer Gerhards
2791bd82f5 Merge branch 'v7-stable'
Conflicts:
	ChangeLog
2013-01-09 16:01:32 +01:00
Martin Carpenter
20265db5a2 Add LOG_AUDIT facility for eg Solaris 2013-01-09 12:12:15 +01:00
Rainer Gerhards
66654e1163 enhance optimizer: detect eq-comparison for syslog facility
... and replace it with a (much faster) prifilt() call
2012-12-11 10:02:00 +01:00
Rainer Gerhards
9faf2240c4 changed TRUE/FALSE to RSTRUE/RSFALSE
This is done to prevent name claches with libraries.
2012-08-22 15:29:02 +02:00
Rainer Gerhards
18e60f46a1 Merge branch 'v4-stable' into v5-stable
Conflicts:
	runtime/debug.h
	runtime/obj.c
	runtime/parser.h
	runtime/wti.h
2012-01-16 16:14:30 +01:00
Rainer Gerhards
f6dea36394 runtime license change 2012-01-16 12:39:01 +01:00
Rainer Gerhards
8f0a8076cc Merge branch 'beta' into master
Conflicts:
	ChangeLog
	configure.ac
	plugins/imudp/imudp.c
	runtime/stream.h
	tests/Makefile.am
	tests/diag.sh
	tools/omfile.c
2010-04-09 13:00:56 +02:00
Rainer Gerhards
8b9cef552d Merge branch 'v4-stable' into v5-stable
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	runtime/debug.c
	runtime/stream.c
	tests/Makefile.am
	tests/diskqueue.sh
	tests/nettester.c
	tools/omfile.c
2010-03-29 11:07:15 +02:00
Rainer Gerhards
9e5b31fc44 bugfix: race condition during directory creation
If multiple files try to create a directory at (almost) the same time,
some of them may fail. This is a data race and also exists with other
processes that may create the same directory. We do now check for this
condition and gracefully handle it.
2010-03-25 07:50:55 +01:00
Rainer Gerhards
f9ec561e6e cleanup: removed debug messages that accidently made it into the commit 2010-03-01 08:41:00 +01:00
Rainer Gerhards
2c39f76037 make $ActonFileDefaultTemplate available to ompipe
This was not honored by the new ompipe module, because it is a local
file directive (it was applied to pipes as a side-effect of using the
same module for pipes and files...). I now made this a global, so that
semantics are the same as previously. Not really nice, but probably
the best thing to do in the current situation (everything else would
involve much more overhead --- leave that for the new config system).
2010-03-01 07:33:09 +01:00
trey
1fc8e4372b patch to make rsyslog compile under Apple OS X
Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2010-02-03 14:55:35 +01:00
Rainer Gerhards
e04e1b5002 enhanced test environment (including testbench)
support for enhancing probability of memory addressing failure by
using non-NULL default value for malloced memory (optional, only if
requested by configure option). This helps to track down some
otherwise undetected issues within the testbench and is expected
to be very useful in the future.
2009-10-22 11:33:38 +02:00
Rainer Gerhards
5af5b1e428 improvements/fixes in queue termination timeout handling
- bugfix: subtle (and usually irrelevant) issue in timout processing
  timeout could be one second too early if nanoseconds wrapped
- set a more sensible timeout for shutdow, now 1.5 seconds to complete
  processing (this also removes those cases where the shutdown message
  was not written because the termination happened before it)
2009-06-25 12:59:13 +02:00
Rainer Gerhards
0917edf26d re-enabled outchannel functionality 2009-06-12 09:47:44 +02:00
Rainer Gerhards
2e388db9ac integrated various patches for solaris
Unfortunatley, I do not have the full list of contributors
available. The patch set was compiled by Ben Taylor, and I made
some further changes to adopt it to the news rsyslog branch. Others
provided much of the base work, but I can not find the names of the
original authors. If you happen to be one of them, please let me
know so that I can give proper credits.
2009-03-05 11:10:43 +01:00
Rainer Gerhards
7b63cd6fed minor things, mostly improved debug info 2008-09-18 12:44:00 +02:00
Rainer Gerhards
60309004df completed better modularity of runtime
- added the ability to specify an error log function for the
  runtime
- removed dependency of core runtime on dirty.h

Note that it is "better" modularity, not perfect. There is still
work to do, but I think we can for the time being proceed with
other things.
2008-04-17 12:46:57 +02:00
Rainer Gerhards
d071de5784 removed no longer needed things
... and some more cleanup. Also moved a file that I forgot
(thanks to Michael Biebl for pointing that out).
2008-04-16 15:45:13 +02:00