From ddcb7d9af0ed6641303be6001270b77a2b70257f Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Oct 2010 09:58:07 +0200 Subject: bugfix: imfile utilizes 32 bit to track offset Most importantly, this problem can not experienced on recent Fedora 64 bit OS (which has 64 bit long's!) --- ChangeLog | 5 +++++ plugins/imfile/imfile.c | 5 ++++- runtime/stream.c | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b16824d..5b9e8fbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ --------------------------------------------------------------------------- +Version 4.4.2a [private build] (rgerhards), 2010-10-15 +- bugfix: imfile utilizes 32 bit to track offset. Most importantly, + this problem can not experienced on Fedora 64 bit OS (which has + 64 bit long's!) +--------------------------------------------------------------------------- Version 4.4.2 [v4-stable] (rgerhards), 2009-10-09 - bugfix: invalid handling of zero-sized messages, could lead to mis- addressing and potential memory corruption/segfault diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c index 927cb82e..1ae6e69a 100644 --- a/plugins/imfile/imfile.c +++ b/plugins/imfile/imfile.c @@ -349,12 +349,15 @@ persistStrmState(fileInfo_t *pInfo) { DEFiRet; strm_t *psSF = NULL; /* state file (stream) */ + size_t lenDir; ASSERT(pInfo != NULL); /* TODO: create a function persistObj in obj.c? */ CHKiRet(strmConstruct(&psSF)); - CHKiRet(strmSetDir(psSF, glbl.GetWorkDir(), strlen((char*)glbl.GetWorkDir()))); + lenDir = strlen((char*)glbl.GetWorkDir()); + if(lenDir > 0) + CHKiRet(strmSetDir(psSF, glbl.GetWorkDir(), lenDir)); CHKiRet(strmSettOperationsMode(psSF, STREAMMODE_WRITE)); CHKiRet(strmSetiAddtlOpenFlags(psSF, O_TRUNC)); CHKiRet(strmSetsType(psSF, STREAMTYPE_FILE_SINGLE)); diff --git a/runtime/stream.c b/runtime/stream.c index 1cff2da6..267e8687 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -779,7 +779,7 @@ rsRetVal strmSerialize(strm_t *pThis, strm_t *pStrm) { DEFiRet; int i; - long l; + int64 l; ISOBJ_TYPE_assert(pThis, strm); ISOBJ_TYPE_assert(pStrm, strm); @@ -801,8 +801,8 @@ rsRetVal strmSerialize(strm_t *pThis, strm_t *pStrm) i = pThis->tOpenMode; objSerializeSCALAR_VAR(pStrm, tOpenMode, INT, i); - l = (long) pThis->iCurrOffs; - objSerializeSCALAR_VAR(pStrm, iCurrOffs, LONG, l); + l = pThis->iCurrOffs; + objSerializeSCALAR_VAR(pStrm, iCurrOffs, INT64, l); CHKiRet(obj.EndSerialize(pStrm)); -- cgit v1.2.3 From 205410c23ade6c7321fc984af26c3d2f590dc1aa Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Oct 2010 06:37:58 -0700 Subject: bugfix: a couple of problems that imfile had on some platforms namely Ubuntu (not their fault, but occured there) --- ChangeLog | 2 ++ runtime/stream.c | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b9e8fbc..7176d295 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ --------------------------------------------------------------------------- Version 4.4.2a [private build] (rgerhards), 2010-10-15 +- bugfix: a couple of problems that imfile had on some platforms, namely + Ubuntu (not their fault, but occured there) - bugfix: imfile utilizes 32 bit to track offset. Most importantly, this problem can not experienced on Fedora 64 bit OS (which has 64 bit long's!) diff --git a/runtime/stream.c b/runtime/stream.c index 267e8687..9997e685 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -96,10 +96,12 @@ static rsRetVal strmOpenFile(strm_t *pThis) iFlags |= pThis->iAddtlOpenFlags; - pThis->fd = open((char*)pThis->pszCurrFName, iFlags, pThis->tOpenMode); + pThis->fd = open((char*)pThis->pszCurrFName, iFlags | O_LARGEFILE, pThis->tOpenMode); if(pThis->fd == -1) { int ierrnoSave = errno; - dbgoprint((obj_t*) pThis, "open error %d, file '%s'\n", errno, pThis->pszCurrFName); + char errmsg[1024]; + dbgoprint((obj_t*) pThis, "open error %d, file '%s': %s\n", errno, pThis->pszCurrFName, + rs_strerror_r(errno, errmsg, sizeof(errmsg))); if(ierrnoSave == ENOENT) ABORT_FINALIZE(RS_RET_FILE_NOT_FOUND); else @@ -522,7 +524,7 @@ rsRetVal strmFlush(strm_t *pThis) * is invalidated. * rgerhards, 2008-01-12 */ -static rsRetVal strmSeek(strm_t *pThis, off_t offs) +static rsRetVal strmSeek(strm_t *pThis, off64_t offs) { DEFiRet; @@ -532,9 +534,9 @@ static rsRetVal strmSeek(strm_t *pThis, off_t offs) strmOpenFile(pThis); else strmFlush(pThis); - int i; + int64 i; dbgoprint((obj_t*) pThis, "file %d seek, pos %ld\n", pThis->fd, (long) offs); - i = lseek(pThis->fd, offs, SEEK_SET); // TODO: check error! + i = lseek64(pThis->fd, offs, SEEK_SET); pThis->iCurrOffs = offs; /* we are now at *this* offset */ pThis->iBufPtr = 0; /* buffer invalidated */ -- cgit v1.2.3 From d1846d8561fe5ecce13248b7b34333362d050c01 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Oct 2010 11:23:03 +0200 Subject: patched version number --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 66a2d70d..7b4797aa 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[4.4.2],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[4.4.2a],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([ChangeLog]) AC_CONFIG_MACRO_DIR([m4]) -- cgit v1.2.3 From da8670d37a49ebda19dea708f716ad66a75f94e4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 24 Nov 2010 15:57:59 +0100 Subject: final preparations for release --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 71f7aef0..5d25cd76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ --------------------------------------------------------------------------- -Version 4.6.5 [v4-stable] (rgerhards), 2010-??-?? +Version 4.6.5 [v4-stable] (rgerhards), 2010-11-24 - bugfix(important): problem in TLS handling could cause rsyslog to loop in a tight loop, effectively disabling functionality and bearing the risk of unresponsiveness of the whole system. -- cgit v1.2.3