[syslog-ng] Re: syslog-ng parser bug?
Balazs Scheidler
bazsi@balabit.hu
Mon, 19 Jul 1999 23:46:16 +0200
--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
On Mon, Jul 19, 1999 at 07:11:55PM +0200, Rolf Offermanns wrote:
> Hi Balazs!
> I think I have found a bug in the config file parser in 1.2.27.
> I will try to describe it as exactly as my english allows me to...
Thanks for the report. The problem was that the first few bytes of those
variable names were the same, so the same filter rule was applied to both
log statement. Try this patch:
--- syslog-ng-1.1.27/src/cfgfile.c Sat Jul 10 17:58:33 1999
+++ syslog-ng/src/cfgfile.c Mon Jul 19 23:38:44 1999
@@ -18,7 +18,7 @@
*
* Inspired by nsyslog, originally written by Darren Reed.
*
- * $Id: cfgfile.c,v 1.17 1999/07/10 15:58:33 bazsi Exp $
+ * $Id: cfgfile.c,v 1.18 1999/07/18 12:56:11 bazsi Exp $
*
*************************************************************************=
**/
=20
@@ -62,7 +62,8 @@
=20
#define RESOLVE_VAR(s, first, next, i) \
for (s =3D first; s; s =3D s->next) { \
- if (strncmp(i->name->data, s->name->data, i->name->length) =3D=
=3D 0) { \
+ if (i->name->length =3D=3D s->name->length && \
+ strncmp(i->name->data, s->name->data, i->name->length) =3D=3D 0) { \
i->ref =3D (struct ol_object *) s; \
break; \
} \
@@ -154,7 +155,7 @@
self->init =3D do_init_config;
self->destroy =3D do_destroy_config;
self->backend =3D backend;
- self->sync_freq =3D 1;
+ self->sync_freq =3D 0;
self->mark_freq =3D 1200; /* 20 minutes */
self->long_hostnames =3D 1;
self->time_reopen =3D 60;
--=20
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
url: http://www.balabit.hu/pgpkey.txt
--EeQfGwPcQSOJBaQU
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
iQEVAwUBN5OcqMGXIGCa+NCpAQH62AgA0TDtSIHFWdf5JBw3KIb/6k6U3YNA34h8
URMt1IKb8MxOrPigKbZZE1ZpyirPJuRNC5ToRDFt9XmXWarhVyIrt3Zgdz0Qcazq
U6FZIbLQARKjrkuRAiDIfpKb+e7Oxo75eGDvW85CecbYk/dqPZIVMzP9h9Hibsk3
zn0RQzXlmku7aYoNoxxCO65rTQu4JQedWYWnq+P+1QbFN0o+useN9glpENxQZk1z
KkYABOOXtYlDr+f+ArodCGyMYZc/9HpzT3d8o2f7Ckbqp0lbpldyescGnkf14RU1
GY1iyPN6p8F4cPi/F9zr+hvScMQGdz0dpLq9pADFFzCEjunHMzJr4Q==
=gK/a
-----END PGP SIGNATURE-----
--EeQfGwPcQSOJBaQU--