[syslog-ng]Re: Backslash-escaped quotes in message strings

Jos Vos syslog-ng@lists.balabit.hu
Sun, 09 Nov 2003 17:54:00 +0100


------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <655.1068396825.1@xos037.xos.nl>

Hi,

Earlier I wrote:

> When a single (') or double (") quote appears in a syslog message,
> this quote gets escaped with a backslash by syslog-ng, which results
> in pretty ugly output, different from what the standard Linux
> sysklogd does (this doesn't change the message).

I have made a patch (attached) to solve this - at least in my specific
situation - but the question is: does this maybe break something else?

Cheers,

-- 
--    Jos Vos <jos@xos.nl>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <655.1068396825.2@xos037.xos.nl>

--- syslog-ng-1.6.0rc4/src/macros.c.orig	2003-04-16 12:15:02.000000000 +0200
+++ syslog-ng-1.6.0rc4/src/macros.c	2003-11-09 17:42:54.000000000 +0100
@@ -348,7 +348,7 @@
 	}
 	case M_MESSAGE: {
 		/* message */
-		length = append_string(dest, left, msg->msg->data, msg->msg->length, escape);
+		length = append_string(dest, left, msg->msg->data, msg->msg->length, 0);
 		break;
 	}
 	default:

------- =_aaaaaaaaaa0--