[syslog-ng] Re: syslog-ng Digest, Vol 6, Issue 10

Jason Pepas cell at ices.utexas.edu
Thu Oct 6 22:26:35 CEST 2005


On Thu, Oct 06, 2005 at 09:10:41PM +0200, syslog-ng-request at lists.balabit.hu wrote:
> >+                    if (left && *src >= '0' && *src <= '9') {
> 
> Consider isdigit(3)

This was done to remain consistent with the existing code.  Do you want
me to enlarge the scope of the patch to change the existing instances of
this as well?

> >+                        while (left && *src >= '0' && *src <= '9') {
> 
> Consider isdigit(3) or parse up to *src == ']'

I avoided parsing up to ']' to avoid the unlikely situation where someone
sends us a mal formatted log entry.  If for some reason I get a message
like "foo[135xyz]", I don't want the xyz part, even though the 135 part
is probably garbage anyway.

> > 	self->msg = c_format_cstring("syslog-ng[%i]: %s", getpid(), >length,
> data);
> > 	self->program = c_format_cstring("syslog-ng");
> >+	self->pid = c_format_cstring("%i", getpid());
> 
> This is wrong! You most certainly don't want to add the pid of the
> receiving syslog-ng process.

seen out of context, that part of the patch is deceptive and misleading
at first glance, but I am pretty certain it is correct.  This is part of
the make_internal_message() function.  Notice the existing call to
getpid() a few lines up where self->msg is being constructed.

> Whitespace/tab damage.

oops!  I probably have broken .vimrc settings.

Also, is macros.gperf an automatically generated file?  I wasn't sure if
I needed to patch that part.

-jason pepas



More information about the syslog-ng mailing list