62 Commits

Author SHA1 Message Date
Rainer Gerhards
b038fe58cc Merge branch 'v7-stable' into v8-stable 2014-07-22 16:21:34 +02:00
Tomas Heinrich
fee75d299b bugfix: check return value of malloc()
Error: NULL_RETURNS (CWE-476):
rsyslog-7.4.10/plugins/omsnmp/omsnmp.c:264: returned_null: Function "malloc(size_t)" returns null (checked 140 out of 168 times).
rsyslog-7.4.10/action.c:1197: example_checked: Example 1: "malloc(batchNumMsgs(pBatch) * 1UL)" has its value checked in "(active = malloc(batchNumMsgs(pBatch) * 1UL)) == NULL".
rsyslog-7.4.10/grammar/lexer.l:302: example_checked: Example 2: "malloc(40UL)" has its value checked in "(bs = malloc(40UL)) == NULL".
rsyslog-7.4.10/grammar/rainerscript.c:2483: example_checked: Example 3: "malloc(8UL)" has its value checked in "(ar->arr = malloc(8UL)) == NULL".
rsyslog-7.4.10/plugins/imklog/bsd.c:221: example_checked: Example 4: "malloc(1UL * (iMaxLine + 1))" has its value checked in "(pRcv = (uchar *)malloc(1UL * (iMaxLine + 1))) == NULL".
rsyslog-7.4.10/plugins/imuxsock/imuxsock.c:968: example_checked: Example 5: "malloc(1UL * (iMaxLine + 1))" has its value checked in "(pRcv = (uchar *)malloc(1UL * (iMaxLine + 1))) == NULL".
rsyslog-7.4.10/plugins/omsnmp/omsnmp.c:264: var_assigned: Assigning: "pdu->enterprise" = null return value from "malloc(size_t)".
rsyslog-7.4.10/plugins/omsnmp/omsnmp.c:265: dereference: Dereferencing a pointer that might be null "pdu->enterprise" when calling "memcpy(void * restrict, void const * restrict, size_t)".
2014-07-22 16:11:35 +02:00
Tomas Heinrich
fb172d5ec0 Prevent passing null to putenv()
Replace putenv() with setenv() which handles memory allocation by itself.

Error: CLANG_WARNING:
rsyslog-7.4.10/plugins/omsnmp/omsnmp.c:206:2: warning: Null pointer passed as an argument to a 'nonnull' parameter
2014-07-22 16:11:03 +02:00
Rainer Gerhards
2df1c99190 omsnmp: support omod v8 interface 2013-11-11 15:28:34 +01:00
Rainer Gerhards
0ad1641dfc regression fix: previous fix introduced wrong default template
The faulty code was never released.
2013-09-03 12:16:26 +02:00
c05e0e76e8 Another fix for bugid# 468
Using OMSRsetEntry now to set the default action template when using new-style config.
See here for more: http://bugzilla.adiscon.com/show_bug.cgi?id=468
2013-07-24 14:53:54 +02:00
ea599342db Fixing new style config format issues from bugid #468
See http://bugzilla.adiscon.com/show_bug.cgi?id=468
Removed CNFPARAM_REQUIRED from all optional parameters.
2013-07-24 14:43:12 +02:00
Rainer Gerhards
e5ef73eb25 bugfix: invalid rsyslog-internal macro API use
This had no bad effect, because the macro did the same as the one
that should have been used.
2012-11-01 17:05:07 +01:00
Rainer Gerhards
07a3478aec omsnmp: support for new config system added & some refactoring 2012-02-08 15:05:32 +01:00
Rainer Gerhards
eda1278ece omsnmp: fixing compile problem 2012-02-01 16:30:07 +01:00
Rainer Gerhards
6624ad434b Merge branch 'v6-stable-noscoping' into master
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	plugins/imfile/imfile.c
	plugins/imklog/imklog.c
	plugins/immark/immark.c
	plugins/imptcp/imptcp.c
	plugins/imrelp/imrelp.c
	plugins/imtcp/imtcp.c
	plugins/imtemplate/imtemplate.c
	plugins/imudp/imudp.c
	plugins/imuxsock/imuxsock.c
	plugins/mmsnmptrapd/mmsnmptrapd.c
	plugins/omtemplate/omtemplate.c
	runtime/glbl.c
	runtime/parser.c
	tools/omfile.c
	tools/syslogd.c
2012-01-19 13:07:46 +01:00
Rainer Gerhards
b38dd53e08 undoing v6.1 config scoping interface, part II (now finished)
This concludes the removal of the new scoping interface, at least as
far as pre v6-plugins are affected. Full code cleanup will happen
in the v6.3 branch.
2012-01-19 12:33:12 +01:00
Rainer Gerhards
ac9afc4149 Merge branch 'v5-stable' into master
Conflicts:
	ChangeLog
	action.h
	configure.ac
	doc/manual.html
	plugins/immark/immark.c
	plugins/impstats/impstats.c
	plugins/imptcp/imptcp.c
	plugins/imtcp/imtcp.c
	runtime/cfsysline.c
	runtime/cfsysline.h
	runtime/conf.c
	runtime/ctok.c
	runtime/ctok.h
	runtime/ctok_token.c
	runtime/ctok_token.h
	runtime/dnscache.h
	runtime/expr.c
	runtime/expr.h
	runtime/rule.c
	runtime/rule.h
	runtime/ruleset.h
	runtime/sysvar.c
	runtime/vm.h
	runtime/vmop.c
	runtime/vmop.h
	runtime/vmprg.c
	runtime/vmprg.h
	runtime/vmstk.c
	runtime/vmstk.h
	tools/omusrmsg.c
2012-01-18 14:08:24 +01:00
Rainer Gerhards
fe4cfa6d1f Merge branch 'v5-stable' into v6-stable
Conflicts:
	plugins/imtcp/imtcp.c
2012-01-14 18:35:09 +01:00
Rainer Gerhards
0871d0a077 Merge branch 'v4-stable' into v5-stable
Conflicts:
	plugins/imfile/imfile.c
	plugins/omtesting/omtesting.c
	tcpsrv.c
	threads.c
2012-01-14 18:32:40 +01:00
Rainer Gerhards
ca39d8e60e more files moved to ASL 2.0 2012-01-12 03:29:19 +01:00
Rainer Gerhards
a7e3afb20b milestone: added module config names 2011-07-20 10:47:24 +02:00
Rainer Gerhards
bbe1f2688c renaming conf.* wasn't a good idea -- undoing
too many dependencies, things get cluttered (and merging probably
gets problematic). Now new config will be "conf2".
2011-04-19 08:24:25 +02:00
Rainer Gerhards
e1c34e1741 renamed conf.c to legacyconf.c to make room for new config system 2011-04-19 07:53:23 +02:00
Rainer Gerhards
6c3ef4dacf Merge branch 'v5-beta'
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	plugins/omlibdbi/omlibdbi.c
	tests/Makefile.am
	tests/diag.sh
2011-03-11 10:24:58 +01:00
Bojan Smojver
d1eb6e0edc added work-around for bug in gtls, which causes fd leak when using TLS
The capability has been added for module to specify that they do not
like being unloaded.
related bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=222

Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2011-02-23 11:25:43 +01:00
Rainer Gerhards
d460c1cd5d fixed regression from last commit
config variables were not properly initialized
2010-07-27 11:38:25 +02:00
Rainer Gerhards
d18b238f16 milestone commit: output plugin interface changes (may NOT run)
The output interface has been changed, but we do not yet utilize the
new interface. Also, it looks like a regression was introduced. But before
hunting it down, I'd like to make a commit (what also easys the regresion
hunt).
2010-07-27 09:44:35 +02: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
e3d9843c85 re-enabled pipe, tty and console in omfile
... by moving code to stream.c. Thanks to the new design, new cases are
not really needed, resulting in cleaner code.

I also did a cleanup of header file usage as a side-activity.
2009-06-12 11:47:00 +02:00
Michael Biebl
1448e2486e make all cflags and libs variables uppercase
pkg-config uses uppercase for its _CFLAGS and _LIBS variable names.
So we follow suit and convert all _cflags and _libs variables to
uppercase for more consistency.
2009-02-24 13:09:44 +01:00
Rainer Gerhards
8256a105cf some more changes to cater for new LogError() interface 2008-07-01 15:17:33 +02:00
Michael Biebl
b6b53972e1 Remove .cvsignore files, add .gitignore.
Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2008-06-11 17:03:47 +02:00
varmojfekoj
d2b63414ef fixed potential segfault due to invalid call to cfsysline
thanks to varmojfekoj for the patch

Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2008-05-14 08:32:40 +02:00
Rainer Gerhards
d9b0c77d3e some more cleanup
reduced dependencies, moved non-runtime files to its own directory except
for some whom's status is unclear
2008-04-16 15:27:53 +02:00
Rainer Gerhards
d7f33053da made everything compile with the new runtime subdirectory 2008-04-16 08:42:00 +02:00
Rainer Gerhards
3a0060c6eb bugfix: omsnmp had a too-small sized buffer for hostname+port.
This could not lead to a segfault, as snprintf() was used, but could cause
some trouble with extensively long hostnames.
2008-04-10 08:43:53 +02:00
Rainer Gerhards
e2436a0104 bugfix: omsnmp did not deref errmsg object on exit (no bad effects caused) 2008-04-08 11:57:08 +02:00
Rainer Gerhards
52a4bdfa41 - added support for high-precision timestamps when receiving legacy syslog
messages
- added new $ActionForwardDefaultTemplate directive
- added new $ActionGSSForwardDefaultTemplate directive
2008-03-28 10:51:41 +00:00
Rainer Gerhards
cdcc0e6710 removed a now-longer needed callback from the output module interface.
Results in reducing code complexity.
2008-03-22 10:30:40 +00:00
Rainer Gerhards
28dcc746bd applied patch from Michael Biebl to clean up build system 2008-03-06 07:39:32 +00:00
b1a83de33a Updated the Adiscon MIBs, they contain a few more definitions for variables
and traps now. The default syslogmessage oid had to change again, as I
    had to reorganize the snmp variables.
2008-03-05 17:23:52 +00:00
Rainer Gerhards
24b02dc831 - extracted logerror*() family of functions from syslogd, made them their
own class and converted to new object calling conventions
    (interface-based)
- converted gss-misc into a loadable library module
2008-03-05 14:53:25 +00:00
05ba3fbffe Added custom mibs for the OMSNMP output module. These mibs are derived from
adiscon monitorware and will be used by default from now on. The mibs
    can be found in the mibs folder of the omsnmp directory. For more
    details please see the documentation. Also added a new configuration
    variable $actionsnmptrapoid which defines the trap-type or
    notification-type that is used.
2008-03-04 16:22:28 +00:00
d88634be6b Changed default SyslogMessageOID to 1.3.6.1.4.1.9.9.41.2.0.1 which means
CISCO-SYSLOG-MIB::clogMessageGenerated. This is a better choice as
    default OID for now. We will add our own MIB in a later step.
2008-03-04 10:36:59 +00:00
Rainer Gerhards
bc7d8ccebb - changed module interface to support querying obj interface (stage work)
- changed module interface version, as the interface change is quite large
2008-03-04 10:27:45 +00:00
Rainer Gerhards
15904a3538 created an initial version of omlibdbi (does not yet work) 2008-02-14 17:47:47 +00:00
Rainer Gerhards
31f122df80 applied patch from Michael Biebl that fixed my doc change from yesterday
which was somewhat incomplete
2008-02-12 08:00:20 +00:00
Rainer Gerhards
e1ebc4be35 done a bit more cleanup on the "rsyslog way of doing things" 2008-02-12 07:40:34 +00:00
f4e7c64f91 Some major changes in the code. The SNMP Session is now stored in the
instance data. So this means we open and close the session only once
    per session. If sending fails, we reinit the snmp session, so suspend
    and resume is now fully and correctly supported. May need some more
    testing against tcp based snmp receivers.
2008-02-11 16:28:29 +00:00
Rainer Gerhards
ecfc30551b a bit more rsyslog-like 2008-02-11 14:56:26 +00:00
ad55b12ac9 Fixed minor bug finalize_it, pdu only needs to be cleaned if snmp_send
failed. Also added documentation to the omsnmp module.
2008-02-11 14:50:25 +00:00
Rainer Gerhards
de41d0b857 done some more work on omsnmp to bring it fully in line with recent rsyslog
developments
2008-02-11 14:00:37 +00:00
Rainer Gerhards
b97d794161 fixed typo 2008-02-11 12:00:49 +00:00
Rainer Gerhards
fbdee85530 adapted omsnmp to the rsyslog way of handling "exceptions" 2008-02-11 11:59:50 +00:00