summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorMichael Meckelein <mmeckelein@hq.adiscon.com>2007-08-31 12:47:35 +0000
committerMichael Meckelein <mmeckelein@hq.adiscon.com>2007-08-31 12:47:35 +0000
commit262111689f19e362100236a37bcd3c7eed6fd769 (patch)
tree01f0b34b500c858c0c45531a622bbd6368bf565e /syslogd.c
parenta24b9f9127f48c7ff7511288ac93f613198892a6 (diff)
downloadrsyslog-1-19-3.tar.gz
rsyslog-1-19-3.tar.xz
rsyslog-1-19-3.zip
patches and docu update for 1.19.3v1-19-3
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/syslogd.c b/syslogd.c
index 5920988c..65af51e8 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -2302,8 +2302,20 @@ int shouldProcessThisMessage(selector_t *f, msg_t *pMsg)
}
if(f->pCSProgNameComp != NULL) {
- if(rsCStrSzStrCmp(f->pCSProgNameComp, (uchar*) getProgramName(pMsg), getProgramNameLen(pMsg))) {
- /* not equal, so we are already done... */
+ int bInv = 0, bEqv = 0, offset = 0;
+ if(*(rsCStrGetSzStr(f->pCSProgNameComp)) == '-') {
+ if(*(rsCStrGetSzStr(f->pCSProgNameComp) + 1) == '-')
+ offset = 1;
+ else {
+ bInv = 1;
+ offset = 1;
+ }
+ }
+ if(!rsCStrOffsetSzStrCmp(f->pCSProgNameComp, offset, (uchar*) getProgramName(pMsg), getProgramNameLen(pMsg)))
+ bEqv = 1;
+
+ if((!bEqv && !bInv) || (bEqv && bInv)) {
+ /* not equal or inverted selection, so we are already done... */
dbgprintf("programname filter '%s' does not match '%s'\n",
rsCStrGetSzStr(f->pCSProgNameComp), getProgramName(pMsg));
return 0;