diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-07-06 08:39:27 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-07-06 08:39:27 +0200 |
commit | 8cd429f7eeee548ff3d5a4d44daa22c2e5a1cf3a (patch) | |
tree | 25e2849f4b65d3fe4079d45088ff5d2c18c33a13 | |
parent | 8fbefa688fc18dd1936158318ec92a108303d2e8 (diff) | |
download | rsyslog-8cd429f7eeee548ff3d5a4d44daa22c2e5a1cf3a.tar.gz rsyslog-8cd429f7eeee548ff3d5a4d44daa22c2e5a1cf3a.tar.xz rsyslog-8cd429f7eeee548ff3d5a4d44daa22c2e5a1cf3a.zip |
issue a warning if old omusrmsg action syntax is used
-rw-r--r-- | runtime/rsyslog.h | 1 | ||||
-rw-r--r-- | tools/omusrmsg.c | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h index 9b14cc92..372453ce 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -350,6 +350,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth RS_RET_FILE_NOT_SPECIFIED = -2180, /**< file name not configured where this was required */ RS_RET_ERR_WRKDIR = -2181, /**< problems with the rsyslog working directory */ RS_RET_WRN_WRKDIR = -2182, /**< correctable problems with the rsyslog working directory */ + RS_RET_OUTDATED_STMT = -2184, /**< some outdated statement/functionality is being used in conf file */ RS_RET_INVLD_CONF_OBJ= -2200, /**< invalid config object (e.g. $Begin conf statement) */ RS_RET_ERR_LIBEE_INIT = -2201, /**< cannot obtain libee ctx */ diff --git a/tools/omusrmsg.c b/tools/omusrmsg.c index d28822ed..3ee01612 100644 --- a/tools/omusrmsg.c +++ b/tools/omusrmsg.c @@ -291,9 +291,17 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1) */ if(!strncmp((char*) p, ":omusrmsg:", sizeof(":omusrmsg:") - 1)) { p += sizeof(":omusrmsg:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ - } else if(!*p || !((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') - || (*p >= '0' && *p <= '9') || *p == '_' || *p == '.' || *p == '*')) + } else { + if(!*p || !((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') + || (*p >= '0' && *p <= '9') || *p == '_' || *p == '.' || *p == '*')) { ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); + } else { + errmsg.LogError(0, RS_RET_OUTDATED_STMT, + "action '%s' treated as ':omusrmsg:%s' - please " + "change syntax, '%s' will not be supported in the future", + p, p, p); + } + } CHKiRet(createInstance(&pData)); |