[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [BusyBox] syslog not logging the "<" char
From:       Magick <magick () Linux-Fan ! com>
Date:       2002-02-22 15:51:03
[Download RAW message or body]

On Fri, 22 Feb 2002 23:13:57 Brad wrote:
> I'm not sure if this is the right place for this, hope I am not 
> irritating anyone.
> 
> I am using BB 0.60.2 in a floppy distro, and the syslog (and logger) is 
> unable to log the "<" char.  This shows up in ppp logfiles.  Has this 
> been fixed somewhere?  I searched through the last several months of 
> archives, and I did try to RTFM...  but no joy.
> 
> #logger "<pcomp>"
> 
> results in "comp>" arriving at the log.
> 
> TIA,
> 
> Brad

Try this patch:
diff -u -b -B -w -p -r1.81 syslogd.c
--- syslogd.c	20 Dec 2001 23:13:23 -0000	1.81
+++ syslogd.c	22 Feb 2002 22:48:04 -0000
@@ -409,15 +409,17 @@ static int serveConnection (int conn)
  		int           pri = (LOG_USER | LOG_NOTICE);
  		char          line[ BUFSIZE + 1 ];
  		unsigned char c;
+		int           got_pri=0;
   		char *q = line;
   		tmpbuf[ n_read - 1 ] = '\0';
   		while (p && (c = *p) && q < &line[ sizeof (line) - 1 ]) {
-			if (c == '<') {
+			if ((c == '<') && !got_pri) {
  			/* Parse the magic priority number. */
  				pri = 0;
+				got_pri=1;
  				while (isdigit (*(++p))) {
  					pri = 10 * pri + (*p - '0');
  				}

-- 
Attack is the secret of defense; defense is the planning of an attack.
  -- Sun Tzu, The Art Of War
Fingerprint = CD4D 5601 287D F075 6F96  6157 99F9 E56A 4B08 6D06

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic