[syslog-ng] syslog-ng3 host_override() issue and proposed fix.

Balazs Scheidler bazsi at balabit.hu
Tue Oct 5 06:57:00 CEST 2010


On Fri, 2010-10-01 at 16:27 -0700, Nat Baldwin wrote:
> Hi there,
> 
> While trying to do something fairly specific with syslog-ng3, I ran into 
> an error with an easy fix. I'm running syslog-ng3 3.1.1_1 on FreeBSD, 
> installed from ports with SSL enabled and everything else default.
> 
> What I was trying to do was to use the host_override() function on a 
> unix-dgram() source.  Time and again it was acting like the 
> program_override() function instead; altering the program entry and not 
> the host entry in the log.  When I went and looked at the source code, I 
> noticed this in logsource.c:
> 
> 145   if (self->options->program_override)
> 146     {
> 147       if (self->options->program_override_len < 0)
> 148         self->options->program_override_len = 
> 			strlen(self->options->program_override);
> 149       log_msg_set_value(msg, LM_V_PROGRAM, 
> 		  self->options->program_override,     
> self->options->program_override_len);
> 150     }
> 151   if (self->options->host_override)
> 152     {
> 153       if (self->options->host_override_len < 0)
> 154         self->options->host_override_len = 
> 			strlen(self->options->host_override);
> 155       log_msg_set_value(msg, LM_V_PROGRAM, 
> 		  self->options->host_override, self->    
> options->host_override_len);
> 156     }
> 
> Taking a not-so-wild guess, I changed line 155 to read:
> log_msg_set_value(msg, LM_V_HOST,self->options->host_override, self->  
> options->host_override_len);
> 
> (changing LM_V_PROGRAM to LM_V_HOST)
> 
> and that fixed my problem. Is this something that can be fixed, or 
> should I be bringing this issue to someone in particular's attention? 

Thanks. I've committed it to 3.1 mainline. It doesn't affect 3.0.


-- 
Bazsi




More information about the syslog-ng mailing list