summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--action.c2
-rw-r--r--runtime/cfsysline.c28
-rw-r--r--runtime/queue.c2
4 files changed, 20 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 2df963a2..c517cb89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,9 @@ Version 7.2.7 [v7-stable] 2013-03-??
- improved debugging support in forked (auto-backgrounding) mode
The rsyslog debug log file is now continued to be written across the
fork.
+- bugfix: using group resolution could lead to endless loop
+ Thanks to Tomas Heinrich for the patch.
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=310
- bugfix: $mmnormalizeuseramsg paramter was specified with wrong type
Thank to Renzhong Zhang for alerting us of the problem.
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=420
diff --git a/action.c b/action.c
index dbd4e702..fd8727ee 100644
--- a/action.c
+++ b/action.c
@@ -255,7 +255,7 @@ actionResetQueueParams(void)
cs.iActionQueueDeqBatchSize = 16; /* default batch size */
cs.iActionQHighWtrMark = 800; /* high water mark for disk-assisted queues */
cs.iActionQLowWtrMark = 200; /* low water mark for disk-assisted queues */
- cs.iActionQDiscardMark = 9800; /* begin to discard messages */
+ cs.iActionQDiscardMark = 980; /* begin to discard messages */
cs.iActionQDiscardSeverity = 8; /* discard warning and above */
cs.iActionQueueNumWorkers = 1; /* number of worker threads for the mm queue above */
cs.iActionQueMaxFileSize = 1024*1024;
diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c
index 6b06d427..a437b7f8 100644
--- a/runtime/cfsysline.c
+++ b/runtime/cfsysline.c
@@ -350,8 +350,9 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p
struct group gBuf;
DEFiRet;
uchar szName[256];
- int bufSize = 2048;
+ int bufSize = 1024;
char * stringBuf = NULL;
+ int err;
assert(pp != NULL);
assert(*pp != NULL);
@@ -361,20 +362,21 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p
ABORT_FINALIZE(RS_RET_NOT_FOUND);
}
-
- CHKmalloc(stringBuf = malloc(bufSize));
- while(pgBuf == NULL) {
- errno = 0;
- getgrnam_r((char*)szName, &gBuf, stringBuf, bufSize, &pgBuf);
- if((pgBuf == NULL) && (errno == ERANGE)) {
- /* Increase bufsize and try again.*/
- bufSize *= 2;
- CHKmalloc(stringBuf = realloc(stringBuf, bufSize));
- }
- }
+ do {
+ /* Increase bufsize and try again.*/
+ bufSize *= 2;
+ CHKmalloc(stringBuf = realloc(stringBuf, bufSize));
+ err = getgrnam_r((char*)szName, &gBuf, stringBuf, bufSize, &pgBuf);
+ } while((pgBuf == NULL) && (err == ERANGE));
if(pgBuf == NULL) {
- errmsg.LogError(0, RS_RET_NOT_FOUND, "ID for group '%s' could not be found or error", (char*)szName);
+ if (err != 0) {
+ rs_strerror_r(err, stringBuf, bufSize);
+ errmsg.LogError(0, RS_RET_NOT_FOUND, "Query for group '%s' resulted in an error: %s\n",
+ (char*)szName, stringBuf);
+ } else {
+ errmsg.LogError(0, RS_RET_NOT_FOUND, "ID for group '%s' could not be found", (char*)szName);
+ }
iRet = RS_RET_NOT_FOUND;
} else {
if(pSetHdlr == NULL) {
diff --git a/runtime/queue.c b/runtime/queue.c
index bb40e540..8d8d8e0a 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -1397,7 +1397,7 @@ qqueueSetDefaultsActionQueue(qqueue_t *pThis)
pThis->iDeqBatchSize = 128; /* default batch size */
pThis->iHighWtrMrk = 800; /* high water mark for disk-assisted queues */
pThis->iLowWtrMrk = 200; /* low water mark for disk-assisted queues */
- pThis->iDiscardMrk = 9800; /* begin to discard messages */
+ pThis->iDiscardMrk = 980; /* begin to discard messages */
pThis->iDiscardSeverity = 8; /* turn off */
pThis->iNumWorkerThreads = 1; /* number of worker threads for the mm queue above */
pThis->iMaxFileSize = 1024*1024;