summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-01-19 15:15:22 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-01-19 15:15:22 +0100
commit9cfa072caa0ba1863c89ae6b41d1c5838b9a42b0 (patch)
treee956f1038085130fff649110f0c725a442f46493
parent9a0e844c914595f59f742c1b7a9f33a1922ecc45 (diff)
downloadrsyslog-9cfa072caa0ba1863c89ae6b41d1c5838b9a42b0.tar.gz
rsyslog-9cfa072caa0ba1863c89ae6b41d1c5838b9a42b0.tar.xz
rsyslog-9cfa072caa0ba1863c89ae6b41d1c5838b9a42b0.zip
bugfix: blanks inside file names did not terminate file name parsing.
This could reslult in the whole rest of a line (including comments) to be treated as file name in "write to file" actions. Thanks to Jack for reporting this issue.
-rw-r--r--ChangeLog4
-rw-r--r--runtime/conf.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c58d5b78..837b1cb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
---------------------------------------------------------------------------
Version 4.5.8 [v4-beta] (rgerhards), 2010-01-??
+- bugfix: blanks inside file names did not terminate file name parsing.
+ This could reslult in the whole rest of a line (including comments)
+ to be treated as file name in "write to file" actions.
+ Thanks to Jack for reporting this issue.
- bugfix: rsyslog hang when writing to a named pipe which nobody was
reading. Thanks to Michael Biebl for reporting this bug.
- bugfix: memory leak when sending messages in zip-compressed format
diff --git a/runtime/conf.c b/runtime/conf.c
index 83ed2e9b..b92664a1 100644
--- a/runtime/conf.c
+++ b/runtime/conf.c
@@ -568,6 +568,7 @@ finalize_it:
* rgerhards, 2007-07-25
* updated to include OMSR pointer -- rgerhards, 2007-07-27
* updated to include template name -- rgerhards, 2008-03-28
+ * rgerhards, 2010-01-19: file names end at the first space
*/
rsRetVal
cflineParseFileName(uchar* p, uchar *pFileName, omodStringRequest_t *pOMSR, int iEntry, int iTplOpts, uchar *pszTpl)
@@ -580,7 +581,7 @@ cflineParseFileName(uchar* p, uchar *pFileName, omodStringRequest_t *pOMSR, int
pName = pFileName;
i = 1; /* we start at 1 so that we reseve space for the '\0'! */
- while(*p && *p != ';' && i < MAXFNAME) {
+ while(*p && *p != ';' && *p != ' ' && i < MAXFNAME) {
*pName++ = *p++;
++i;
}