[syslog-ng] Antw: [PATCH] afinter: Make the parent class LogSrcDriver, instead of LogDriver.

Balazs Scheidler bazsi at balabit.hu
Tue May 1 13:27:38 CEST 2012


Hi,

I did that, but forgot to push the merge. I did that now, and also
released 3.4.0alpha2 that should be ok in this regard.

Thanks for the note.


On Tue, 2012-04-10 at 09:39 +0200, Peter Eisenlohr wrote:
> Hi,
> 
> since the large NVTable patch has been re-applied (1c3a37764d), this
> patch should be committed soon, as syslog-ng currently still crashes
> when a mark is logged.
> 
>    Peter
> 
> 
> 
> Dipl.-Inf. Peter Eisenlohr
> Geschäftsbereich Logistik
> INFORM GmbH, Pascalstr. 23, 52076 Aachen, Germany
> Telefon: (+49) 2408 9456-6000
> E-Mail: peter.eisenlohr at inform-software.com, Web:
> http://www.inform-software.com
> INFORM Institut fur Operations Research und Management GmbH
> Registered AmtsG Aachen HRB1144 Gfhr. Adrian Weiler
> 
> >>> Gergely Nagy <algernon at balabit.hu> 06.04.12 11.36 Uhr >>>
> The parent of AFInterSourceDriver should be LogSrcDriver, because
> that's the struct we pass down to it anyway, and other parts of the
> code will cast it back to LogSrcDriver, too.
> 
> But if its parent is LogDriver, as it was, we were corrupting the
> later parts of the original LogSrcDriver, with values from
> AFInterSourceDriver.
> 
> Many thanks to Peter Eisenlohr <peter.eisenlohr at inform-software.com>
> for initial debugging, and for pinpointing mark messages as the
> triggers.
> 
> Reported-by: Peter Czanik <czanik at balabit.hu>
> Signed-off-by: Gergely Nagy <algernon at balabit.hu>
> ---
> lib/afinter.c | 10 +++++-----
> lib/afinter.h | 2 +-
> 2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/afinter.c b/lib/afinter.c
> index 23b1c82..b9d0ddf 100644
> --- a/lib/afinter.c
> +++ b/lib/afinter.c
> @@ -304,7 +304,7 @@ afinter_source_new(AFInterSourceDriver *owner,
> LogSourceOptions *options)
> AFInterSource *self = g_new0(AFInterSource, 1);
> 
> log_source_init_instance(&self->super);
> - log_source_set_options(&self->super, options, 0, SCS_INTERNAL,
> owner->super.id, NULL, FALSE);
> + log_source_set_options(&self->super.super, options, 0, SCS_INTERNAL,
> owner->super.super.id, NULL, FALSE);
> afinter_source_init_watches(self);
> self->super.super.init = afinter_source_init;
> self->super.super.deinit = afinter_source_deinit;
> @@ -328,7 +328,7 @@ afinter_sd_init(LogPipe *s)
> return FALSE;
> }
> 
> - log_source_options_init(&self->source_options, cfg,
> self->super.group);
> + log_source_options_init(&self->source_options, cfg,
> self->super.super.group);
> self->source = afinter_source_new(self, &self->source_options);
> log_pipe_append(&self->source->super, s);
> log_pipe_init(&self->source->super, cfg);
> @@ -370,9 +370,9 @@ afinter_sd_new(void)
> AFInterSourceDriver *self = g_new0(AFInterSourceDriver, 1);
> 
> log_src_driver_init_instance((LogSrcDriver *)&self->super);
> - self->super.super.init = afinter_sd_init;
> - self->super.super.deinit = afinter_sd_deinit;
> - self->super.super.free_fn = afinter_sd_free;
> + self->super.super.super.init = afinter_sd_init;
> + self->super.super.super.deinit = afinter_sd_deinit;
> + self->super.super.super.free_fn = afinter_sd_free;
> log_source_options_defaults(&self->source_options);
> return (LogDriver *)&self->super.super;
> }
> diff --git a/lib/afinter.h b/lib/afinter.h
> index 108475f..1cd9d78 100644
> --- a/lib/afinter.h
> +++ b/lib/afinter.h
> @@ -33,7 +33,7 @@
> */
> typedef struct _AFInterSourceDriver
> {
> - LogDriver super;
> + LogSrcDriver super;
> LogSource *source;
> LogSourceOptions source_options;
> } AFInterSourceDriver;
> -- 
> 1.7.9.1
> 
> 
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation:
> http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
> 
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
> 

-- 
Bazsi




More information about the syslog-ng mailing list