On Monday 04 March 2013 20:19, [email protected] wrote:
> From: Jonh Wendell <[email protected]>
> 
> Currently we are ignoring the '-l' command line with
> regards to remote logging. We're sending all logs to
> the remote machine.
> 
> This patch makes remote logging behave just like local
> logging by honoring the '-l' flag.
> 
> Signed-off-by: Jonh Wendell <[email protected]>
> ---
>  sysklogd/syslogd.c |   87 
> ++++++++++++++++++++++++++++++----------------------
>  1 file changed, 51 insertions(+), 36 deletions(-)
> 
> diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
> index 3fe3f53..a19ad6e 100644
> --- a/sysklogd/syslogd.c
> +++ b/sysklogd/syslogd.c
> @@ -758,6 +758,24 @@ static void timestamp_and_log_internal(const char *msg)
>       timestamp_and_log(LOG_SYSLOG | LOG_INFO, (char*)msg, 0);
>  }
>  
> +static int extract_prio (char **buf)
> +{
> +     char *p = *buf;
> +     int pri = (LOG_USER | LOG_NOTICE);
> +
> +     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);
> +     }
> +
> +     buf = &p;

This does not look right: you assign to a local variable
which is about to exit its scope.

> +     return pri;
> +}

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to