bin/100018: newsyslog(8) does not check size if time_at is used

Gavin Atkinson gavin at FreeBSD.org
Thu Jul 17 13:48:48 UTC 2008


On Thu, 2008-07-17 at 05:34 -0700, Arne Wörner wrote:
> --- On Thu, 7/17/08, gavin at FreeBSD.org <gavin at FreeBSD.org> wrote:
> > -		} else if (ent->hours <= 0 &&
> > (ent->flags & CE_TRIMAT)) {
> > +		} else if ((ent->hours <= 0 &&
> > (ent->flags & CE_TRIMAT)) &&
> > +		    check_time_rotate) {
> >
> thx for ur effort...
> unfortunately i do not have any fbsd box currently...
> 
> but i did a lazy code inspection and think, that it looks ok...
> but:
> } else if ((ent->flags & CE_TRIMAT) && check_time_rotate) {
> should suffice, since "check_time_rotate" cant become 1 if "ent->hours
> > 0" or can it? not really sure... :)

You are correct, it cannot become 1 unless "ent->hours > 0", however
"ent->hours > 0" can be true without check_time_rotate becoming 1.  It's
quite a hard piece of code to understand, but I've tested it extensively
and can't make it misbehave.

Thanks for looking!

Gaivn


More information about the freebsd-bugs mailing list