summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-31 16:07:40 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-31 16:07:40 +0000
commit9234c95d74fb015e839cf5fe5ebbdf138e4a760d (patch)
tree85b2c8498405d0cbecafb38f4251e02860bc74ce /syslogd.c
parent074ece90c0b7f32307716eeb6d0308b83197b6ce (diff)
downloadrsyslog-9234c95d74fb015e839cf5fe5ebbdf138e4a760d.tar.gz
rsyslog-9234c95d74fb015e839cf5fe5ebbdf138e4a760d.tar.xz
rsyslog-9234c95d74fb015e839cf5fe5ebbdf138e4a760d.zip
omfile.c now uses the new table-driven cfsysline system
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/syslogd.c b/syslogd.c
index 04013f48..173015d4 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -3566,12 +3566,13 @@ rsRetVal cfsysline(uchar *p)
CHKiRet(doCustomHdlr(&p, doNameLine, (void*) DIR_OUTCHANNEL));
} else if(!strcasecmp((char*) szCmd, "allowedsender")) {
CHKiRet(doCustomHdlr(&p, doNameLine, (void*) DIR_ALLOWEDSENDER));
+ } else if(!strcasecmp((char*) szCmd, "umask")) {
+ CHKiRet(doFileCreateMode(&p, (void*) setUmask, NULL));
+#if 0
} else if(!strcasecmp((char*) szCmd, "dircreatemode")) {
CHKiRet(doFileCreateMode(&p, NULL, &fDirCreateMode));
} else if(!strcasecmp((char*) szCmd, "filecreatemode")) {
CHKiRet(doFileCreateMode(&p, NULL, &fCreateMode));
- } else if(!strcasecmp((char*) szCmd, "umask")) {
- CHKiRet(doFileCreateMode(&p, (void*) setUmask, NULL));
} else if(!strcasecmp((char*) szCmd, "dirowner")) {
CHKiRet(doGetUID(&p, NULL, &dirUID));
} else if(!strcasecmp((char*) szCmd, "dirgroup")) {
@@ -3582,6 +3583,7 @@ rsRetVal cfsysline(uchar *p)
CHKiRet(doGetGID(&p, NULL, &fileGID));
} else if(!strcasecmp((char*) szCmd, "dynafilecachesize")) {
CHKiRet(doGetInt(&p, (void*) setDynaFileCacheSize, NULL));
+#endif
} else if(!strcasecmp((char*) szCmd, "repeatedmsgreduction")) {
CHKiRet(doBinaryOptionLine(&p, NULL, &bReduceRepeatMsgs));
} else if(!strcasecmp((char*) szCmd, "controlcharacterescapeprefix")) {
@@ -3590,12 +3592,14 @@ rsRetVal cfsysline(uchar *p)
CHKiRet(doBinaryOptionLine(&p, NULL, &bEscapeCCOnRcv));
} else if(!strcasecmp((char*) szCmd, "dropmsgswithmaliciousdnsptrrecords")) {
CHKiRet(doBinaryOptionLine(&p, NULL, &bDropMalPTRMsgs));
+#if 0
} else if(!strcasecmp((char*) szCmd, "createdirs")) {
CHKiRet(doBinaryOptionLine(&p, NULL, &bCreateDirs));
- } else if(!strcasecmp((char*) szCmd, "debugprinttemplatelist")) {
- CHKiRet(doBinaryOptionLine(&p, NULL, &bDebugPrintTemplateList));
} else if(!strcasecmp((char*) szCmd, "failonchownfailure")) {
CHKiRet(doBinaryOptionLine(&p, NULL, &bFailOnChown));
+#endif
+ } else if(!strcasecmp((char*) szCmd, "debugprinttemplatelist")) {
+ CHKiRet(doBinaryOptionLine(&p, NULL, &bDebugPrintTemplateList));
} else if(!strcasecmp((char*) szCmd, "droptrailinglfonreception")) {
CHKiRet(doBinaryOptionLine(&p, NULL, &bDropTrailingLF));
} else if(!strcasecmp((char*) szCmd, "resetconfigvariables")) {
@@ -3607,12 +3611,18 @@ rsRetVal cfsysline(uchar *p)
CHKiRet(doCustomHdlr(&p , resetConfigVariables, NULL));
} else if(!strcasecmp((char*) szCmd, "modload")) {
CHKiRet(doCustomHdlr(&p, doModLoad, NULL));
- } else { /* invalid command! */
- char err[100];
- snprintf(err, sizeof(err)/sizeof(char),
- "Invalid command in $-configline: '%s' - line ignored\n", szCmd);
- logerror(err);
- ABORT_FINALIZE(RS_RET_INVALID_CMD);
+ } else {
+ /* we now try and see if we can find the command in the registered
+ * list of cfsysline handlers. -- rgerhards, 2007-07-31
+ */
+ if((iRet = processCfSysLineCommand(szCmd, &p)) != RS_RET_OK) {
+ /* invalid command! */
+ char err[256];
+ snprintf(err, sizeof(err)/sizeof(char),
+ "Invalid command in $-configline: '%s' (error %d) - line ignored\n", szCmd, iRet);
+ logerror(err);
+ ABORT_FINALIZE(RS_RET_INVALID_CMD);
+ }
}
/* now check if we have some extra characters left on the line - that