123 Commits

Author SHA1 Message Date
David Ahern
19e5d06f66 omfwd imudp: Add support for bind-to-device
Add support for bind-to-device option to omfwd and imudp modules.
Configured using device="name". Only new syntax format is supported.
e.g.,

input(type="imudp" port=["10514"] device="eth0" name="udp")
action(type="omfwd" Target="192.168.1.23" Port="10514" Device="eth0")

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
2016-11-15 17:55:56 -07:00
Rainer Gerhards
51c03c66e0 make inline functions C99-compliant
As it seems, different C compilers have different rules/interpretations
on inline functions. The current code base did not properly obey all C99
rules. We fix this by converting some functions to macros and others to
include the necessary C99 plumbing. We also remove some inline attributes
for functions where this seems to be to agressive (aka "function to big").

This fixes build problems in some environments and is a general code
cleanup measure.
2016-09-05 16:47:14 +02:00
Rainer Gerhards
2407693552 TLS forwarding: slightly improved error message
especially in the common case that a certificat file is not present.
The GnuTLS provided error messages is pretty misleading, so we now
check this ourselves.

Note that further improvements to TLS error reporting are desirable,
this fixes just one annoying case that frequently causes confusion.
2016-08-23 13:02:06 +02:00
Rainer Gerhards
8a8675b223 fix compiler warnings 2016-06-02 10:18:05 +02:00
Rainer Gerhards
a2b83c4a3f fix invalid use of cstrGetSzStr() 2016-05-19 12:29:02 +02:00
Rainer Gerhards
f8738727f9 change cstrFinalize() interface
the function can no longer fail and it is not expected that this
will ever happen again in the future. So we remove the return value,
giving a small speedup to the code.
2016-05-19 10:49:37 +02:00
Rainer Gerhards
9382a555cc gnutls driver: better wording in error case that could be caused by broken connection
see also https://github.com/rsyslog/rsyslog/issues/846
2016-04-23 14:47:18 +02:00
888a8ae5b9 gnutls: Possible fix for issue #732
Commit 1394e0bec2
changed how the receive buffer was freed in rcv() call. However Retry handling
was not considered properly.
2016-03-01 12:20:22 +01:00
Rainer Gerhards
240a7fe8f6 travis: re-enable full test environment, turn on extra warnings 2016-01-27 08:37:53 +01:00
Rainer Gerhards
11404600c1 travis: track down why we still get compile errors 2016-01-27 08:17:09 +01:00
Rainer Gerhards
740dc44202 fix or suppress compiler warnings 2016-01-26 18:25:38 +01:00
1394e0bec2 gnutls: fixed memory leak when gtlsRecordRecv returned a failure.
When the connection was broken and gtlsRecordRecv returned a
failure, pszRcvBuf was not freed. The code to free pszRcvBuf has
been moved to finalize_it if iRet is not RS_RET_OK.
2015-12-01 11:15:18 +01:00
Charles Southerland
6272aa12bc Possible fix for #575 2015-11-05 14:52:40 -06:00
Rainer Gerhards
9399f0a503 nsd_gtls: remove unused parameter 2015-05-18 10:33:39 +02:00
Rainer Gerhards
21674039db use gnutls_certificate_type_set_priority() only if available
The gnutls_certificate_type_set_priority function is deprecated
and not available in recent GnuTLS versions. However, there is no
doc how to properly replace it with gnutls_priority_set_direct.
A lot of folks have simply removed it, when they also called
gnutls_set_default_priority. This is what we now also do. If
this causes problems or someone has an idea of how to replace
the deprecated function in a better way, please let us know!
In any case, we use it as long as it is available and let
not insult us by the deprecation warnings.
2015-05-18 10:33:39 +02:00
Rainer Gerhards
23c5b3e1e6 replace deprecated GnuTLS functions with newer ones if available
closes https://github.com/rsyslog/rsyslog/issues/302
2015-05-18 10:33:39 +02:00
Jan Gerhards
9125ddf99d add global parameter "debug.gnutls"
enables GnuTLS indepth debugging
closes https://github.com/rsyslog/rsyslog/issues/219
2015-01-26 16:02:24 +01:00
Reed Morrison
e301ed53d5 Adding options for tcp keep alive. 2014-12-13 18:15:51 +01:00
Rainer Gerhards
537a5aa90a undo commit 077d59c2c7984eb0273be949969585be241408c8 due to regression
There is a regression in this feature-add commit and I don't have the
time to search for it. Refering it back to contributor.

see also https://github.com/rsyslog/rsyslog/pull/145
2014-11-03 17:05:18 +01:00
Tomas Heinrich
077d59c2c7 imtcp: add options to configure keep-alive params
New options:        (legacy counterparts)
keepalive.time      $inputtcpserverkeepalive_time
keepalive.probes    $inputtcpserverkeepalive_probes
keepalive.interval  $inputtcpserverkeepalive_interval

The options are set separately for each instance.

This patch bumps the interface version of the nsd,
netstrm and tcpsrv modules.
2014-10-30 15:34:39 +01:00
Rainer Gerhards
b34c35e38f replace deprecated gnutls data types with current one
Note that the "current ones" were introduced in GNUTls 1.2.0 and
we already require at least 1.4.0, so this does not cause any
problem with platforms rsyslog already runs on.
2014-09-30 14:42:34 +02:00
Reed Morrison
7c515efa36 Fixing bug with keep-alive with gtls. 2014-09-19 23:43:13 -07:00
Rainer Gerhards
20d8a9904e make gntls tcp syslog driver emit more error messages
Messages previously emitted only to the debug log are now emitted as
syslog error messages. It has shown that they contain information
helpful to the user for troubleshooting config issues. Note that this
change is a bit experimental, as we are not sure if there are situations
where large amounts of error messages may be emitted.
2014-09-05 13:02:28 +02:00
Tomas Heinrich
04bf9d5d81 bugfix: don't leak an open FD
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/runtime/nsd_gtls.c:120: open_fn: Returning handle opened by function "open(char const *, int, ...)".
rsyslog-7.4.10/runtime/nsd_gtls.c:120: var_assign: Assigning: "fd" = handle returned from "open((char *)pszFile, 0)".
rsyslog-7.4.10/runtime/nsd_gtls.c:126: noescape: Resource "fd" is not freed or pointed-to in function "fstat(int, struct stat *)".
rsyslog-7.4.10/runtime/nsd_gtls.c:139: noescape: Resource "fd" is not freed or pointed-to in function "read(int, void *, size_t)".
rsyslog-7.4.10/runtime/nsd_gtls.c:154: leaked_handle: Handle variable "fd" going out of scope leaks the handle.
2014-07-22 17:44:01 +02:00
Rainer Gerhards
f7ad21626f silence compiler warnings
mostly cosmetic things
2014-03-16 10:52:54 +01:00
Rainer Gerhards
5a09d0915b bugfix: segfault on startup if TCP TLS was used but no cert or key set 2013-09-13 12:08:56 +02:00
Rainer Gerhards
7903677bfb Merge branch 'v7-stable' into v7-stable-tlsfix
Conflicts:
	ChangeLog
	runtime/rsyslog.h
2013-09-13 02:39:42 +02:00
Rainer Gerhards
ad77733062 bugfix: segfault on startup if TLS was used but no CA cert set 2013-09-13 02:37:06 +02:00
Tomas Heinrich
4d83139192 Utilize the new rsCStr*Strf() functions 2013-04-09 17:20:29 +02:00
Tomas Heinrich
6923b9a4a7 Check return code from gnutls_x509_crt_get_*_dn
Enlarge the supplied buffer if necessary.
2013-04-09 17:20:29 +02:00
Rainer Gerhards
9ca63ee532 fix: gtls stream driver must support new interface 2013-01-24 07:17:09 +01:00
88faed212c Fixed TCP CheckConnection handling in omfwd.c.
Interface needed to be changed in lower stream classes. Syslog TCP Sending is now resumed properly.
2012-08-25 12:08:08 -07:00
Rainer Gerhards
b80b0672be Merge branch 'v5-devel'
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	plugins/imuxsock/imuxsock.c
	runtime/modules.c
2011-12-16 12:51:12 +01:00
Rainer Gerhards
f3ff6a6cd6 Merge branch 'beta' 2011-12-12 09:36:15 +01:00
Rainer Gerhards
d98ac49d24 Merge branch 'v5-stable' into beta 2011-12-01 11:30:25 +01:00
Rainer Gerhards
d2da5f39d0 Merge branch 'v4-stable' into v5-stable
Conflicts:
	action.c
2011-12-01 11:30:10 +01:00
Rainer Gerhards
cb0087ec47 Merge branch 'v3-stable' into v4-stable 2011-12-01 11:26:24 +01:00
Tomas Heinrich
ffa6e3b941 bugfix: cosmetic: proper constant used instead of number in open call
Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2011-12-01 11:18:49 +01:00
Rainer Gerhards
272f0a5b3d Merge branch 'beta'
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	doc/v6compatibility.html
2011-10-27 09:56:54 +02:00
Rainer Gerhards
16dc3aab3d Merge branch 'v5-stable' into beta
Conflicts:
	ChangeLog
2011-10-27 09:46:41 +02:00
Rainer Gerhards
f3a7232069 Merge branch 'v4-stable' into v5-stable
Conflicts:
	ChangeLog
2011-10-27 09:39:45 +02:00
Tomas Heinrich
9b305b5de5 bugfix: potential abort after reading invalid X.509 certificate
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=290

Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2011-10-27 09:37:27 +02:00
Rainer Gerhards
1c96bcba4f one further change to support gnutls without libgcrypt 2011-10-21 15:29:51 +02:00
Rainer Gerhards
e770177555 Merge branch 'v5-devel'
Conflicts:
	ChangeLog
2011-10-21 15:03:53 +02:00
Rainer Gerhards
e61672c693 removed dependency on gcrypt for recently-enough GnuTLS
see: http://bugzilla.adiscon.com/show_bug.cgi?id=289
2011-10-17 15:49:20 +02:00
Rainer Gerhards
fee3347784 Merge branch 'v5-stable' into beta
Conflicts:
	ChangeLog
	runtime/nsd_gtls.c
	tcpsrv.c
	tests/Makefile.am
2011-06-14 15:09:41 +02:00
Rainer Gerhards
f4c5f0a4cc Merge branch 'v4-devel' into v5-devel
Conflicts:
	tcpsrv.c
2011-06-14 14:22:37 +02:00
Rainer Gerhards
bcd956d4d5 bugfix: memory leak in imtcp & subsystems under some circumstances
This leak is tied to error conditions which lead to incorrect cleanup
of some data structures. [backport from v6, limited testing under v4]
2011-06-14 12:52:02 +02:00
Rainer Gerhards
fdc25fb14b bugfix: TLS-induced smaller memory still existed, now fixed 2011-06-14 12:23:33 +02:00
Rainer Gerhards
42d36fbf3a bugfix: TLS-mode memory leak was not completely fixed with previous commit 2011-06-14 11:25:07 +02:00