summaryrefslogtreecommitdiffstats
path: root/omusrmsg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-27 16:55:40 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-27 16:55:40 +0000
commit1d96a98daf4ac4c4ec9e664e328f1aac4bf6af9e (patch)
tree249ec71321b657a6a37b91f1d03f4e2c4bf07697 /omusrmsg.c
parent8193522d85290df659d8c2e505e8c47f39db9267 (diff)
downloadrsyslog-1d96a98daf4ac4c4ec9e664e328f1aac4bf6af9e.tar.gz
rsyslog-1d96a98daf4ac4c4ec9e664e328f1aac4bf6af9e.tar.xz
rsyslog-1d96a98daf4ac4c4ec9e664e328f1aac4bf6af9e.zip
- added omsr object (objomsr.c, objomsr.h) - template request for output
modules - changed doAction() interface - templates and output string generation for doActon() is now fully
Diffstat (limited to 'omusrmsg.c')
-rw-r--r--omusrmsg.c42
1 files changed, 10 insertions, 32 deletions
diff --git a/omusrmsg.c b/omusrmsg.c
index 3c47fb8d..96b18375 100644
--- a/omusrmsg.c
+++ b/omusrmsg.c
@@ -247,15 +247,15 @@ BEGINdoAction
CODESTARTdoAction
dprintf("\n");
/* TODO: change wallmsg so that it returns iRet */
- wallmsg(f, pMsg, pData);
+ wallmsg(f, ppString[0], pData);
ENDdoAction
BEGINparseSelectorAct
uchar *q;
int i;
- char szTemplateName[128];
CODESTARTparseSelectorAct
+CODE_STD_STRING_REQUESTparseSelectorAct(1)
#if 0 /* TODO: think about it and activate later - see comments in else below */
if(**pp != '*')
@@ -267,20 +267,11 @@ CODESTARTparseSelectorAct
if(*p == '*') { /* wall */
dprintf ("write-all");
+ ++p; /* eat '*' */
pData->bIsWall = 1; /* write to all users */
- if(*(p+1) == ';') {
- /* we have a template specifier! */
- p += 2; /* eat "*;" */
- if((iRet = cflineParseTemplateName(&p, szTemplateName,
- sizeof(szTemplateName) / sizeof(uchar))) != RS_RET_OK)
- return iRet;
- }
- else /* assign default format if none given! */
- szTemplateName[0] = '\0';
- if(szTemplateName[0] == '\0')
- strcpy(szTemplateName, " WallFmt");
- if((iRet = cflineSetTemplateAndIOV(f, szTemplateName)) == RS_RET_OK)
- dprintf(" template '%s'\n", szTemplateName);
+ if((iRet = cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*) " WallFmt"))
+ != RS_RET_OK)
+ return iRet;
} else {
/* everything else is currently treated as a user name
* TODO: we must reconsider this - see also comment in
@@ -300,26 +291,13 @@ CODESTARTparseSelectorAct
q++;
p = q;
}
- /* done, now check if we have a template name
+ /* done, on to the template
* TODO: we need to handle the case where i >= MAXUNAME!
*/
- szTemplateName[0] = '\0';
- if(*p == ';') {
- /* we have a template specifier! */
- ++p; /* eat ";" */
- if((iRet = cflineParseTemplateName(&p, szTemplateName,
- sizeof(szTemplateName) / sizeof(char))) != RS_RET_OK)
- return iRet;
- }
- if(szTemplateName[0] == '\0')
- strcpy(szTemplateName, " StdUsrMsgFmt");
- iRet = cflineSetTemplateAndIOV(f, szTemplateName);
- /* NOTE: if you intend to do anything else here, be sure to
- * chck iRet - as we currently have nothing else to do, we do not
- * care (yet).
- */
+ if((iRet = cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*)" StdUsrMsgFmt"))
+ != RS_RET_OK)
+ return iRet;
}
-
ENDparseSelectorAct