diff options
author | Michael Biebl <biebl@debian.org> | 2013-01-09 00:02:49 +0100 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2013-01-09 00:02:49 +0100 |
commit | 3793efd744861415cbb0e10df6ac9eab7b21e78e (patch) | |
tree | 41b82e478e0e35e6583057eb1196409265d4dabc /runtime | |
parent | ed0fad5385d95f30f7073bf3013e4ecabc4b29e4 (diff) | |
download | rsyslog-3793efd744861415cbb0e10df6ac9eab7b21e78e.tar.gz |
Imported Upstream version 7.2.5upstream/7.2.5
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/Makefile.in | 1 | ||||
-rw-r--r-- | runtime/datetime.c | 6 | ||||
-rw-r--r-- | runtime/msg.c | 2 | ||||
-rw-r--r-- | runtime/ruleset.c | 25 |
4 files changed, 25 insertions, 9 deletions
diff --git a/runtime/Makefile.in b/runtime/Makefile.in index 73b2d3b..7a5718e 100644 --- a/runtime/Makefile.in +++ b/runtime/Makefile.in @@ -293,6 +293,7 @@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ +LIBM = @LIBM@ LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ diff --git a/runtime/datetime.c b/runtime/datetime.c index 53bc165..7d97447 100644 --- a/runtime/datetime.c +++ b/runtime/datetime.c @@ -61,8 +61,10 @@ timeval2syslogTime(struct timeval *tp, struct syslogTime *t) struct tm *tm; struct tm tmBuf; long lBias; + time_t secs; - tm = localtime_r((time_t*) &(tp->tv_sec), &tmBuf); + secs = tp->tv_sec; + tm = localtime_r(&secs, &tmBuf); t->year = tm->tm_year + 1900; t->month = tm->tm_mon + 1; @@ -77,7 +79,7 @@ timeval2syslogTime(struct timeval *tp, struct syslogTime *t) /* Solaris uses a different method of exporting the time zone. * It is UTC - localtime, which is the opposite sign of mins east of GMT. */ - lBias = -(daylight ? altzone : timezone); + lBias = -(tm->tm_isdst ? altzone : timezone); # elif defined(__hpux) lBias = tz.tz_dsttime ? - tz.tz_minuteswest : 0; # else diff --git a/runtime/msg.c b/runtime/msg.c index 09f6d64..10605ba 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -3027,6 +3027,8 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, */ ; /*DO NOTHING*/ } else { + if(iTo > bufLen) /* iTo is very large, if no to-position is set in the template! */ + iTo = bufLen; iLen = iTo - iFrom + 1; /* the +1 is for an actual char, NOT \0! */ pBufStart = pBuf = MALLOC((iLen + 1) * sizeof(char)); if(pBuf == NULL) { diff --git a/runtime/ruleset.c b/runtime/ruleset.c index 3459f54..b74f8ec 100644 --- a/runtime/ruleset.c +++ b/runtime/ruleset.c @@ -299,7 +299,9 @@ execIf(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) sbool bRet; DEFiRet; newAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + FINALIZE; if(pBatch->pElem[i].state == BATCH_STATE_DISC) continue; /* will be ignored in any case */ if(active == NULL || active[i]) { @@ -315,13 +317,16 @@ execIf(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) scriptExec(stmt->d.s_if.t_then, pBatch, newAct); } if(stmt->d.s_if.t_else != NULL) { - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) - ; ++i) + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + FINALIZE; if(pBatch->pElem[i].state != BATCH_STATE_DISC) newAct[i] = !newAct[i]; + } scriptExec(stmt->d.s_if.t_else, pBatch, newAct); } freeActive(newAct); +finalize_it: RETiRet; } @@ -334,7 +339,9 @@ execPRIFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) int bRet; int i; newAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + return; if(pBatch->pElem[i].state == BATCH_STATE_DISC) continue; /* will be ignored in any case */ pMsg = (msg_t*)(pBatch->pElem[i].pUsrp); @@ -355,10 +362,12 @@ execPRIFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) scriptExec(stmt->d.s_prifilt.t_then, pBatch, newAct); } if(stmt->d.s_prifilt.t_else != NULL) { - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) - ; ++i) + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + return; if(pBatch->pElem[i].state != BATCH_STATE_DISC) newAct[i] = !newAct[i]; + } scriptExec(stmt->d.s_prifilt.t_else, pBatch, newAct); } freeActive(newAct); @@ -461,7 +470,9 @@ execPROPFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) sbool bRet; int i; thenAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + return; if(pBatch->pElem[i].state == BATCH_STATE_DISC) continue; /* will be ignored in any case */ if(active == NULL || active[i]) { |