Hi,
here's a patch correcting the behavior of the '$ActionQueueMaxFileSize'
directive. Looks like a simple int overflow with interesting
consequences; using a value above a certain threshold (10g is enough)
causes:
- there's a single spool file created for every message
- spooled messages are not resent
The steps to reproduce it are not straightforward and aren't that much
important as this can be seen to be a bug just from looking at the code.
Tomas
>From e05a17d9ff78ac037c76d6299920a07c4a3c2240 Mon Sep 17 00:00:00 2001
From: Tomas Heinrich <[email protected]>
Date: Thu, 18 Jul 2013 14:00:11 +0200
Subject: [PATCH] bugfix: correction to the interface of stream obj
The datatype of the argument to SetiMaxFileSize() was too small and
could overflow.
The SetMaxFileSize() interface wasn't used at all (possibly confused
with SetiMaxFileSize()) and was dropped.
---
runtime/stream.c | 2 +-
runtime/stream.h | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/runtime/stream.c b/runtime/stream.c
index 54210e4..94fc0ca 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -1605,7 +1605,7 @@ finalize_it:
/* property set methods */
/* simple ones first */
DEFpropSetMeth(strm, bDeleteOnClose, int)
-DEFpropSetMeth(strm, iMaxFileSize, int)
+DEFpropSetMeth(strm, iMaxFileSize, int64)
DEFpropSetMeth(strm, iFileNumDigits, int)
DEFpropSetMeth(strm, tOperationsMode, int)
DEFpropSetMeth(strm, tOpenMode, mode_t)
diff --git a/runtime/stream.h b/runtime/stream.h
index 61d5ede..4f4a430 100644
--- a/runtime/stream.h
+++ b/runtime/stream.h
@@ -158,7 +158,6 @@ BEGINinterface(strm) /* name must also be changed in ENDinterface macro! */
rsRetVal (*Construct)(strm_t **ppThis);
rsRetVal (*ConstructFinalize)(strm_t *pThis);
rsRetVal (*Destruct)(strm_t **ppThis);
- rsRetVal (*SetMaxFileSize)(strm_t *pThis, int64 iMaxFileSize);
rsRetVal (*SetFileName)(strm_t *pThis, uchar *pszName, size_t iLenName);
rsRetVal (*ReadChar)(strm_t *pThis, uchar *pC);
rsRetVal (*UnreadChar)(strm_t *pThis, uchar c);
@@ -176,7 +175,7 @@ BEGINinterface(strm) /* name must also be changed in ENDinterface macro! */
rsRetVal (*SetWCntr)(strm_t *pThis, number_t *pWCnt);
rsRetVal (*Dup)(strm_t *pThis, strm_t **ppNew);
INTERFACEpropSetMeth(strm, bDeleteOnClose, int);
- INTERFACEpropSetMeth(strm, iMaxFileSize, int);
+ INTERFACEpropSetMeth(strm, iMaxFileSize, int64);
INTERFACEpropSetMeth(strm, iMaxFiles, int);
INTERFACEpropSetMeth(strm, iFileNumDigits, int);
INTERFACEpropSetMeth(strm, tOperationsMode, int);
--
1.7.10.4
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE
THAT.