248 Commits

Author SHA1 Message Date
Rainer Gerhards
a82bb9cb2d "fix" Coverity scan false positives 2017-11-23 09:15:56 +01:00
Rainer Gerhards
5b1115bdde omfile: ensure filename buffers are NUL terminated
with very long file / directory names, we may have left the filename
buffers unterminated (missing NUL byte). This patch corrects it.

Detected by Coverty scan, CID 185337
2017-10-27 13:19:51 +02:00
Rainer Gerhards
75ed9c0955 omfile: hande file open error via SUSPEND mode
For a while, this lead to suspension as the data error was
not detected by the rule engine. This has changed with fixes
in 8.30.0. I asked users what they prefer (and expect) and
everyone meant it should still be handled via suspension. See
github tracker below for more details.

closes https://github.com/rsyslog/rsyslog/issues/1832
2017-10-18 11:34:07 +02:00
Rainer Gerhards
9f95005ebf Merge pull request #1511 from PascalWithopf/solaris
workaround for solaris testbench
2017-04-13 16:20:55 +02:00
Rainer Gerhards
8d67c03d45 solaris: fix coding issues 2017-04-11 10:18:42 +02:00
PascalWithopf
e94e8beede omfile: add error if both file and dynafile are set
also adds a test.
closes https://github.com/rsyslog/rsyslog/issues/1346
2017-03-28 14:26:28 +02:00
Rainer Gerhards
43db4f8233 Merge pull request #1362 from PascalWithopf/linelength
codestyle: line length adjusted
2017-01-17 10:26:23 +01:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
Rainer Gerhards
7619ad2c20 bugfix: bFlushOnTxEnd == 0 not honored when writing w/o async writer
If bFlushOnTXEnd is set, we need to flush on transaction end - in
any case. It is not relevant if this is using background writes
(which then become pretty slow) or not. And, similarly, no flush
happens when it is not set.

closes https://github.com/rsyslog/rsyslog/issues/1297
2017-01-13 13:51:37 +01:00
Rainer Gerhards
448f16495c remove "inline" attribute from excessivly long functions 2016-10-26 11:50:15 +02:00
Rainer Gerhards
aa0056dcba bugfix omfile: handle chown() failure correctly
If the file creation succeeds, but chown() failed, the file was
still writen, even if the user requested that this should be treated
as a failure case. This is corrected by this commit.

Alos, some refactoring was done to create better error messages.
2016-07-04 11:47:56 +02:00
Rainer Gerhards
a120a550f6 omfile: do not flag file name errors in dynafiles as error
This is a quick and dirty workaround; it is really hard to tell
what is the right thing to do in this case AND preserve existing
user configurations.
2016-06-21 14:19:57 +02:00
Rainer Gerhards
b3940cb966 remove excessive "inline" attributes 2016-06-03 12:24:27 +02:00
Rainer Gerhards
5e3b075d53 fix compiler warnings 2016-06-02 12:08:55 +02:00
Rainer Gerhards
23762fcfb4 omfile fix: memleak on exit
upon action termination (rsyslog shutdown), stats objects were not
destructed
2016-04-25 17:21:21 +02:00
Rainer Gerhards
6c97d17239 refactor
for discussion, see also https://github.com/rsyslog/rsyslog/pull/684
2015-12-13 10:32:37 +01:00
chengbaochuan
1ee8b86faa change code style 2015-12-10 17:43:15 +08:00
c6226
6de1849467 fix bug for memory overflow 2015-12-08 21:52:56 +08:00
Rainer Gerhards
6de01034a3 bugfix: omfile writes partial lines in when async writing is enabled 2015-10-14 14:42:00 +02:00
Tomas Heinrich
80f42190a9 Remove redundant code 2015-07-18 22:05:28 +02:00
Tomas Heinrich
008f0097b6 Prevent a segfault in dynafile creation
A failure during the dynafile creation (in prepareFile(), most of the
time) led to a misaddressing and a segfault.
2015-07-18 22:04:25 +02:00
Thordur Bjornsson
835571774d omfile: unconditionally include fcntl.h.
required for open() flags
2015-07-07 12:34:08 +02:00
Florian Riedl
c15a8da02e Typo fix in omfile.c 2015-04-30 18:05:54 +02:00
Rainer Gerhards
a4de007774 omfile: refactor error message handling 2015-02-24 13:05:49 +01:00
Rainer Gerhards
423c3ac62c pstats: add "origin" paramter to stats records
see also: https://github.com/rsyslog/rsyslog/issues/119
2014-11-19 15:49:09 +01:00
Rainer Gerhards
c62acb81af Merge branch 'v8-stable' 2014-06-04 15:35:55 +02:00
Rainer Gerhards
de74860c17 Merge branch 'v7-stable' into v8-stable
Conflicts:
	tools/syslogd.c
2014-06-04 15:35:46 +02:00
Rainer Gerhards
6757ec6dd4 make rsyslogd -v output work in regard to 64 bit atomic buildin info 2014-06-04 15:25:29 +02:00
Rainer Gerhards
adf30b1419 janitor omfile: change default, correctly set for legacy config 2014-05-19 11:35:12 +02:00
Rainer Gerhards
ff01bb6e38 janitor omfile: add impstats support for close timeouts
also some minor cleanup at other spots
2014-05-16 18:54:31 +02:00
Rainer Gerhards
83c32e8a6a janitor: cleanup on exit 2014-05-16 14:32:49 +02:00
Rainer Gerhards
fcf8e953b0 janitor: base functionality given for omfile 2014-05-16 14:22:20 +02:00
Karol Jurak
1b536ae0b2 omfile: add module parameters: FileOwner, FileOwnerNum, FileGroup, ... 2014-03-31 13:01:43 +02:00
Rainer Gerhards
26f07e7597 typo fix
Thanks to github user schplat for alerting us.
See (embedded in larger issue): https://github.com/rsyslog/rsyslog/issues/35
2014-02-23 12:30:48 +01:00
Nate Brown
b41b86b009 Add ownership directives to overall omfile module config 2014-01-27 20:07:29 -08:00
Rainer Gerhards
6d2e8e965e another round of qualifiers 2013-12-10 18:29:05 +01:00
Rainer Gerhards
640eac451e Merge branch 'v7-devel' 2013-12-10 10:17:14 +01:00
Tomas Heinrich
bee044da0d Add directives for numerically specifying GIDs/UIDs
The already present directives (FileOwner, FileGroup, DirOwner,
DirGroup) translate names to numerical IDs, which depends on the user
information being available during rsyslog's startup. This can fail if
the information is obtained over a network or from a service such as
SSSD. The new directives provide a way to specify the numerical IDs
directly and bypass the lookup.
2013-12-10 10:13:28 +01:00
Rainer Gerhards
98583a20c9 refactor regression fix: typo causing segfault 2013-12-04 18:36:46 +01:00
Rainer Gerhards
6ee2dc5ddd do no longer use void* ptr in iparams as we know we deal with strings 2013-12-04 16:57:42 +01:00
Rainer Gerhards
4695ab7c3e refactor output system string handling 2013-12-04 16:49:22 +01:00
Rainer Gerhards
b5dcbf9167 refactor: do not require transactional omods to provide doAction() 2013-12-04 12:30:52 +01:00
Rainer Gerhards
4bcccb64fd refactor: another round of qualifiers... 2013-12-04 12:10:07 +01:00
Rainer Gerhards
fb6dd02afc refactor milestone: create first PoC of commitTransaction() entry point 2013-12-04 11:38:07 +01:00
Rainer Gerhards
be36ef5009 refactor doAction omod interface
we do no longer support the iMsgOpts parameter
2013-12-04 09:24:11 +01:00
Rainer Gerhards
140b5b22c0 cleanup/beautify 2013-12-03 18:57:05 +01:00
Rainer Gerhards
2c9562b710 Merge branch 'v7-devel'
Conflicts:
	tools/omfile.c
2013-12-03 18:20:20 +01:00
Rainer Gerhards
6737f9b92f Merge branch 'v7-stable' into v7-devel 2013-12-03 18:17:32 +01:00
Rainer Gerhards
1059001874 nit: name change
change name in oldest supported versions in order to make future
merging easier ;)
2013-12-03 18:17:04 +01:00
Rainer Gerhards
a16113442e cleanup 2013-12-03 15:06:49 +01:00