[busybox][RFC] syslogging errors

Rob Landley rob at landley.net
Tue Jun 20 14:06:40 UTC 2006


On Monday 19 June 2006 4:45 am, Bernhard Fischer wrote:
> On Sat, Jun 17, 2006 at 10:54:37AM -0400, Rob Landley wrote:
> >On Friday 16 June 2006 4:59 pm, Bernhard Fischer wrote:
> >> Hi,
> >>
> >> [thinking about post 1.2.x cosmetic stuff a little bit..]
> >>
> >> we have several places where we need (currently do and want to) log
> >> errors via syslog ({loginutils,init}/* comes to mind, network may do too
> >> as well as others).
> >>
> >> Therefore i'm asking for a genericized facility to accomplish this task,
> >> resp. satisfy this need.
> >
> >Could you give me more detail about what's wrong with the facilities we
> > have now, please?
>
> What facility are you referring to? I must have overread it.

man 3 syslog

> >> As a widely used facility, error_msg/perror_msg et al come to mind.
> >
> >Yeah but you don't want a normal user to run busybox unzip and fill up the
> > log with messages that say "Cannot read input."  Make it a separate set
> > of
>
> I was not talking about these. I was talking about
> "{loginutils,init}/* comes to mind, network may do too as well as
> others"

error_msg/perror_msg et == "{loginutils,init}/*

Ok, now I'm confused.  What exactly are you proposing?

> >functions please, writing an error message to stdout and logging an error
>
> You must have overread the 3 choices i asked about. Here they are again:
> a) provide a globally exported int bb_log_level; to be used sd the
>    `syslog´ priority via bb_verror_msg()

Writing things to the log is not something that bb_error_msg() currently does, 
and not what it's for.  Writing messages to the log and writing them to 
stderr are very different actions.  The vast majority of programs do not 
write things via syslog, and the ability for a normal user to fill up syslog 
with crap is a widely recognize security issue.

> b) a separate bb_sverror_msg() or

I could see that.  I'd want to call it something more obvious like 
syslog_printf().

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list