177 Commits

Author SHA1 Message Date
Trent Piepho
5c35619385 imklog: Fix permitnonkernelfacility not working
permitnonkernelfacility doesn't work when the new configuration syntax
is used, e.g. 'module(load="imklog" permitnonkernelfacility="on")'.
It does work with the old syntax, e.g. '$KLogPermitNonKernelFacility
on'

This is because the old style config is stored in a static global
struct "cs", while the new style config is passed in as a pointer.
Code in imklog will put old style config entries into the new config
struct, and almost all the code in imklog uses the new config struct
like it should.  Except for a check for bPermitNonKernel in Syslog()
that continued to use the static global that only has old style
configs.

Fix this by passing pModConf down into Syslog() and using that in
place of the static global.

closes https://github.com/rsyslog/rsyslog/issues/477
2017-07-18 14:31:29 +02:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Rainer Gerhards
448f16495c remove "inline" attribute from excessivly long functions 2016-10-26 11:50:15 +02:00
Rainer Gerhards
bbcbb03c64 fix compiler warnings 2016-07-22 15:00:28 +02:00
Rainer Gerhards
5e3b075d53 fix compiler warnings 2016-06-02 12:08:55 +02:00
Rainer Gerhards
e8c8e96e27 refactor time-obtaining functions so that the can obtain time in UTC
This works where the time is picked up locally.
2016-01-11 18:52:42 +01:00
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
Rainer Gerhards
4e7ebcf5e2 imklog: fix esoteric memory free bug
This was found by clang static analyzer. We don't believe this
could ever cause problems in practice, because the bug happens
only when rsyslog runs out of memory. In any case, the new version
is more robust and easier to understand.
2015-06-26 10:53:27 +02:00
Rainer Gerhards
7e309e38e8 fix regression from ee035ef55248463f04834a5beda054170d931ec0
did no longer build due to missing prototypes
2015-01-09 10:38:56 +01:00
Paul Donohue
244d365f21 bugfix imklog: infinite loop on OpenVZ VMs 2015-01-08 16:16:12 -05:00
Rainer Gerhards
a407348963 refactor PRI-handling code 2014-10-08 12:50:10 +02:00
Rainer Gerhards
b9427fa9a2 Merge branch 'v8-stable'
Conflicts:
	ChangeLog
	configure.ac
2014-09-30 12:14:36 +02:00
Chris Hiszpanski
20d869968b Added LIBLOGGING_STDLOG_CFLAGS and LIBLOGGING_STDLOG_LIBS to automake sources
Build was failing when using these variables
2014-09-25 05:06:57 -07: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
2a9f4e6030 Merge branch 'v5.8.6-prifix' into v5.8.13-prifix
Conflicts:
	plugins/imklog/imklog.c
2014-09-16 12:11:09 +02:00
Rainer Gerhards
20a8056ac7 fix compile problems and cleanup
most importantly, we do no longer use the LOG_FAC() and LOG_PRI() macro
names, which may conflict with systems names and may act other than
expected by a user.
2014-09-16 11:46:41 +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
cd6937f35b do not accept out of bounds PRI values
further reference: CVE-2014-3634
2014-09-15 15:10:40 +02:00
Tomas Heinrich
6d6564f1fd bugfix: add a missing pointer assignment 2014-07-11 15:19:43 +02:00
Rainer Gerhards
1afd79df5f bugfix: imklog issued wrong facility in error messages
...what could lead to problems in other parts of the code
2013-01-15 14:27:33 +01:00
Rainer Gerhards
42cd1fa7d7 Merge branch 'v7-stable'
Conflicts:
	configure.ac
	doc/manual.html
	plugins/imfile/imfile.c
	plugins/imklog/bsd.c
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
2012-11-22 11:05:45 +01:00
Rainer Gerhards
ae7b78cdb2 imklog: add new config params to module() parameter set
This is based on Marius Tomaschewski's set of patches, mostly
just applied manually (as I need to mangle with the merge).
2012-11-22 10:08:43 +01:00
Rainer Gerhards
84a5d7b138 Merge branch 'v5-stable' into v6-stable
Note: this was not a simple merge, I rather needed to adopt the v5 code to
the new v6 config handling. However, no v6 config format has been added yet
(this is the next step).

Conflicts:
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
2012-11-22 09:45:05 +01:00
Rainer Gerhards
b78af2aaf5 bugfix: imklog mistakenly took kernel timestamp subseconds as nanoseconds
... actually, they are microseconds. So the fractional part of the
timestamp was not properly formatted.
Thanks to Marius Tomaschwesky for the bug report and the patch idea.
2012-11-22 08:57:57 +01:00
Marius Tomaschewski
f040bde7a0 imklog: added $klogParseKernelTimestamp option
When enabled, kernel message [timestamp] is converted for message time.
Default is to use receive time as in 5.8.x and before, because the clock
used to create the timestamp is not supposed to be as accurate as the
monotonic clock (depends on hardware and kernel) resulting in differences
between kernel and system messages which occurred at same time.
2012-11-21 18:15:00 +01:00
Marius Tomaschewski
318a6fb577 imklog: added $klogKeepKernelTimestamp option
When enabled, the kernel [timestamp] remains at begin of
each message, even it is used for the message time too.
2012-11-21 18:13:48 +01:00
Rainer Gerhards
a7c5807346 imklog, impstats: support for new rate-limiting API added 2012-10-19 10:03:30 +02:00
Rainer Gerhards
fa4119e874 imklog: add paramter "keepkerneltimestamp"
Thanks to Marius Tomaschweski for the suggestion and a patch (for v5)
that this commit bases on.
2012-10-17 17:17:43 +02:00
Rainer Gerhards
a21fe156df Merge branch 'v6-stable' into beta 2012-10-17 16:56:12 +02:00
Rainer Gerhards
e544df3f39 Merge branch 'v6-stable' into v6-beta 2012-10-17 16:55:57 +02:00
Rainer Gerhards
db21912aa8 Merge branch 'v5-stable' into v6-stable
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
2012-10-17 16:51:59 +02:00
Marius Tomaschewski
d4f9c384c2 imklog: use memmove instead of memcpy (solaris) 2012-10-17 15:04:43 +02:00
Marius Tomaschewski
51754401f7 imklog: use memmove to remove kernel timestamp 2012-10-17 14:47:27 +02:00
Marius Tomaschewski
49a5c0c3b9 imklog: skip leading spaces in kernel timestamp 2012-10-17 14:46:35 +02:00
Rainer Gerhards
5a993ad742 imklog: removal of no longer needed config directives 2012-06-29 12:59:46 +02:00
Rainer Gerhards
8e8b77c7ef Merge branch 'beta' into master-module
Conflicts:
	ChangeLog
	configure.ac
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
2012-06-29 12:54:49 +02:00
Rainer Gerhards
99e4bbc0e4 imklog: cleanup of no longer used code 2012-06-29 12:47:13 +02:00
Rainer Gerhards
cb2a78b30b imklog: support for module() global config parameters added 2012-06-29 12:42:08 +02:00
Rainer Gerhards
9ec02e670a cleanup: removed unused but set parameters 2012-04-23 17:31:26 +02:00
Rainer Gerhards
d6da57ae03 Merge branch 'v5-stable-newstats'
Conflicts:
	action.c
	configure.ac
	doc/imuxsock.html
	plugins/imklog/imklog.c
	plugins/imptcp/imptcp.c
	plugins/imtcp/imtcp.c
	plugins/imudp/imudp.c
	plugins/imuxsock/imuxsock.c
	runtime/glbl.c
	runtime/glbl.h
	runtime/net.c
	runtime/ruleset.c
	tcpsrv.h
	tools/syslogd.c
2012-04-07 15:42:46 +02:00
Rainer Gerhards
d53016962d Merge branch 'v5-stable-newstats' into v5-devel
Conflicts:
	configure.ac
	doc/manual.html
2012-04-07 14:44:12 +02:00
Rainer Gerhards
1d6d534df2 unified use of $LocalHostIPIF among all locally-emitting inputs
with the exception of imdiag, which I humbly do not think needs this
capabilit (even counter-productive for testbench use).
2012-03-22 16:06:57 +01:00
Rainer Gerhards
f90675f33f Merge branch 'v5-stable-newstats' into v5-devel
Conflicts:
	ChangeLog
	action.c
	configure.ac
	doc/imuxsock.html
	doc/manual.html
	runtime/queue.c
2012-03-12 17:00:21 +01:00
Rainer Gerhards
50a94aa1c7 added capability to use a local interface IP address as fromhost-ip for imklog 2012-03-10 18:29:40 +01:00
Rainer Gerhards
16811e2f38 Merge branch 'v6-stable' 2012-03-01 12:29:19 +01:00
Rainer Gerhards
115718de96 Merge branch 'v5-stable' into v5-devel
Conflicts:
	ChangeLog
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
2012-03-01 12:25:39 +01:00
Rainer Gerhards
c2970de8b0 bugfix: imklog invalidly computed facility and severity
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=313
2012-03-01 12:19:32 +01:00
Rainer Gerhards
aafa9b41a5 bugfix: imklog invalidly computed facility and severity
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=313
2012-03-01 12:16:59 +01:00
Rainer Gerhards
1773bfa14b Merge branch 'v6-stable'
Conflicts:
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
	runtime/conf.c
	runtime/rsyslog.h
2012-01-27 13:52:27 +01:00