[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: Syslogd Patch
From: Denys Vlasenko <vda.linux () googlemail ! com>
Date: 2010-12-27 2:21:47
Message-ID: 201012270321.47242.vda.linux () googlemail ! com
[Download RAW message or body]
On Thursday 16 December 2010 12:29, Ronaldo Zacarias Afonso wrote:
> Hi,
>
> My name is Ronaldo, this is my first post to this mailing list.
> I have been using Busybox for a while and, because of a project, I
> had to change Busybox syslogd to only send syslog messages less than
> the Log Level set by the -l command line switch when it's sending
> messages to a remote syslog server. I know -l is used just for local
> message, but I was wandering if it would be nice if this switch
> command line was also used in remote log messages.
> Attached is the patch.
Perhaps it needs to be a separate switch, say, -r NUM?
/* Remote site cannot trust _us_ anyway and need to do validation again */
for (item = G.remoteHosts; item != NULL; item = item->link) {
+ char *p = recvbuf;
+ int pri = (LOG_USER | LOG_NOTICE);
Please use consistent indentation.
+ if (*p == '<') {
+ /* Parse the magic priority number */
+ pri = bb_strtou(p + 1, &p, 10);
+ if (*p == '>')
+ p++;
+ if (pri & ~(LOG_FACMASK | LOG_PRIMASK))
+ pri = (LOG_USER | LOG_NOTICE);
+ }
You duplicated priority parsing code, so there are two copies of it,
and with "-R HOST -L" (log remotely AND locally)
parsing will be done twice. Can it be done once?
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic