summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-06-25 12:52:18 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-06-25 12:52:18 +0200
commitaddadb75ebd22d1175c7e20d1095e35a46b71448 (patch)
tree5df935e71068204c813fc7ccc159c734f405b736 /plugins
parentd040868f97fa92f1df31b2ac7ff835dc4f3c29be (diff)
downloadrsyslog-addadb75ebd22d1175c7e20d1095e35a46b71448.tar.gz
rsyslog-addadb75ebd22d1175c7e20d1095e35a46b71448.tar.xz
rsyslog-addadb75ebd22d1175c7e20d1095e35a46b71448.zip
bugfix: comments after actions were not properly treated.
For some actions (e.g. forwarding(, this could also lead to invalid configuration.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/omgssapi/omgssapi.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/plugins/omgssapi/omgssapi.c b/plugins/omgssapi/omgssapi.c
index 28c3880b..34abfe0a 100644
--- a/plugins/omgssapi/omgssapi.c
+++ b/plugins/omgssapi/omgssapi.c
@@ -554,7 +554,7 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
/* extract the host first (we do a trick - we replace the ';' or ':' with a '\0')
* now skip to port and then template name. rgerhards 2005-07-06
*/
- for(q = p ; *p && *p != ';' && *p != ':' ; ++p)
+ for(q = p ; *p && *p != ';' && *p != ':' && *p != '#' ; ++p)
/* JUST SKIP */;
pData->port = NULL;
@@ -578,25 +578,18 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
}
}
+
/* now skip to template */
bErr = 0;
- while(*p && *p != ';') {
- if(*p && *p != ';' && !isspace((int) *p)) {
- if(bErr == 0) { /* only 1 error msg! */
- bErr = 1;
- errno = 0;
- errmsg.LogError(NO_ERRCODE, "invalid selector line (port), probably not doing "
- "what was intended");
- }
- }
- ++p;
- }
+ while(*p && *p != ';' && *p != '#' && !isspace((int) *p))
+ ++p; /*JUST SKIP*/
/* TODO: make this if go away! */
- if(*p == ';') {
+ if(*p == ';' || *p == '#' || isspace(*p)) {
+ uchar cTmp = *p;
*p = '\0'; /* trick to obtain hostname (later)! */
CHKmalloc(pData->f_hname = strdup((char*) q));
- *p = ';';
+ *p = cTmp;
} else {
CHKmalloc(pData->f_hname = strdup((char*) q));
}