[syslog-ng] [PATCH] logrewrite: Fix the logrewrite cloning functions.

Gergely Nagy algernon at balabit.hu
Fri Nov 18 14:54:30 CET 2011


Repair the rewrite clone funcions, to correctly clone the value_handle
and conditions aswell.

Without this, if we use rewrite in multiple logpaths, only the first
will behave correctly, the cloned ones will all rewrite the $MESSAGE
macro instead, because that's the default.

Signed-off-By: Zoltan Fried <deirf at balabit.hu>
Signed-off-By: Gergely Nagy <algernon at balabit.hu>
---
 lib/logrewrite.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/logrewrite.c b/lib/logrewrite.c
index d282f6f..a578439 100644
--- a/lib/logrewrite.c
+++ b/lib/logrewrite.c
@@ -165,6 +165,8 @@ log_rewrite_subst_clone(LogProcessPipe *s)
 
   cloned = (LogRewriteSubst *) log_rewrite_subst_new(self->replacement->template);
   cloned->matcher = log_matcher_ref(self->matcher);
+  cloned->super.value_handle = self->super.value_handle;
+  cloned->super.condition = self->super.condition;
   return &cloned->super.super.super;
 }
 
@@ -227,6 +229,8 @@ log_rewrite_set_clone(LogProcessPipe *s)
   LogRewriteSet *cloned;
 
   cloned = (LogRewriteSet *) log_rewrite_set_new(self->value_template->template);
+  cloned->super.value_handle = self->super.value_handle;
+  cloned->super.condition = self->super.condition;
   return &cloned->super.super.super;
 }
 
-- 
1.7.7.3




More information about the syslog-ng mailing list