summaryrefslogtreecommitdiff
path: root/plugins/omgssapi
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2008-07-23 02:22:26 +0200
committerMichael Biebl <biebl@debian.org>2008-07-23 02:22:26 +0200
commita0a154c1e0b88afbe3cabc2a5a4d3a4523681576 (patch)
tree8ab4f9d7e06b45a9874c0d5ad25223de133ef206 /plugins/omgssapi
parent991c6cc7f1b1586b3fad07460503bb9f7a34ad07 (diff)
downloadrsyslog-a0a154c1e0b88afbe3cabc2a5a4d3a4523681576.tar.gz
Imported Upstream version 3.18.1upstream/3.18.1
Diffstat (limited to 'plugins/omgssapi')
-rw-r--r--plugins/omgssapi/omgssapi.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/plugins/omgssapi/omgssapi.c b/plugins/omgssapi/omgssapi.c
index be05177..34abfe0 100644
--- a/plugins/omgssapi/omgssapi.c
+++ b/plugins/omgssapi/omgssapi.c
@@ -4,7 +4,7 @@
* NOTE: read comments in module-template.h to understand how this file
* works!
*
- * Copyright 2007 Rainer Gerhards and Adiscon GmbH.
+ * Copyright 2007, 2008 Rainer Gerhards and Adiscon GmbH.
*
* This file is part of rsyslog.
*
@@ -79,7 +79,7 @@ DEFobjCurrIf(gssutil)
DEFobjCurrIf(tcpclt)
typedef struct _instanceData {
- char f_hname[MAXHOSTNAMELEN+1];
+ char *f_hname;
short sock; /* file descriptor */
enum { /* TODO: we shoud revisit these definitions */
eDestFORW,
@@ -162,6 +162,9 @@ CODESTARTfreeInstance
tcpclt.Destruct(&pData->pTCPClt);
if(pData->sock >= 0)
close(pData->sock);
+
+ if(pData->f_hname != NULL)
+ free(pData->f_hname);
ENDfreeInstance
@@ -551,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;
@@ -575,27 +578,21 @@ 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)! */
- strcpy(pData->f_hname, (char*) q);
- *p = ';';
- } else
- strcpy(pData->f_hname, (char*) q);
+ CHKmalloc(pData->f_hname = strdup((char*) q));
+ *p = cTmp;
+ } else {
+ CHKmalloc(pData->f_hname = strdup((char*) q));
+ }
/* process template */
CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS,
@@ -701,6 +698,5 @@ CODEmodInit_QueryRegCFSLineHdlr
ENDmodInit
#endif /* #ifdef USE_GSSAPI */
-/*
- * vi:set ai:
+/* vi:set ai:
*/