summaryrefslogtreecommitdiffstats
path: root/omshell.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-24 06:25:48 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-24 06:25:48 +0000
commitd9653ad08ffd2e8578aac00777cd610fce1f05c1 (patch)
treece968e2fcd68b8c19dfa9fee127ea9c4f9b53ff1 /omshell.c
parentd06dafb6768e2bbb4128aa4370fc3dc53fc01056 (diff)
downloadrsyslog-d9653ad08ffd2e8578aac00777cd610fce1f05c1.tar.gz
rsyslog-d9653ad08ffd2e8578aac00777cd610fce1f05c1.tar.xz
rsyslog-d9653ad08ffd2e8578aac00777cd610fce1f05c1.zip
moved selector action config parsing for shell action to omshell
Diffstat (limited to 'omshell.c')
-rw-r--r--omshell.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/omshell.c b/omshell.c
index 05d61a9e..9ea80a0c 100644
--- a/omshell.c
+++ b/omshell.c
@@ -61,6 +61,41 @@ int doActionShell(selector_t *f)
return 0;
}
+
+/* try to process a selector action line. Checks if the action
+ * applies to this module and, if so, processed it. If not, it
+ * is left untouched. The driver will then call another module
+ */
+rsRetVal parseSelectorActShell(uchar **pp, selector_t *f)
+{
+ uchar *p;
+ rsRetVal iRet = RS_RET_CONFLINE_PROCESSED;
+
+ assert(pp != NULL);
+ assert(f != NULL);
+
+ p = *pp;
+
+ switch (*p)
+ {
+ case '^': /* bkalkbrenner 2005-09-20: execute shell command */
+ dprintf("exec\n");
+ ++p;
+ cflineParseFileName(f, p);
+ if (f->f_type == F_FILE) {
+ f->f_type = F_SHELL;
+ f->doAction = doActionShell;
+ }
+ default:
+ iRet = RS_RET_CONFLINE_UNPROCESSED;
+ break;
+ }
+
+ if(iRet == RS_RET_CONFLINE_PROCESSED)
+ *pp = p;
+ return iRet;
+}
+
/* query an entry point
*/
static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())