Page MenuHomeFreeBSD

newsyslog: check for rename failure during log rotation
ClosedPublic

Authored by chris.longros_gmail.com on Wed, Mar 25, 7:04 PM.
Tags
None
Referenced Files
F150436619: D56088.id174345.diff
Wed, Apr 1, 5:25 AM
Unknown Object (File)
Mon, Mar 30, 6:00 AM
Unknown Object (File)
Sun, Mar 29, 5:21 PM
Unknown Object (File)
Sun, Mar 29, 2:06 PM
Unknown Object (File)
Sat, Mar 28, 8:14 PM
Unknown Object (File)
Fri, Mar 27, 6:59 PM
Unknown Object (File)
Fri, Mar 27, 2:01 PM
Unknown Object (File)
Fri, Mar 27, 9:37 AM
Subscribers

Details

Summary

Add a missing error check on rename(2) when shifting compressed
log files. On failure, warn and skip the affected file.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

warn wouldn't seem to be ideal to me, but it matches how everything else is reported for 'routine' or 'expected' errors.

This revision is now accepted and ready to land.Wed, Mar 25, 7:16 PM
glebius added inline comments.
usr.sbin/newsyslog/newsyslog.c
1958–1960

That will more stylish.

usr.sbin/newsyslog/newsyslog.c
1958–1960

Do you maybe mean

else if (rename(zfile1, zfile2) != 0)

?

usr.sbin/newsyslog/newsyslog.c
1958–1960

Yes, of course, sorry for that.

This revision now requires review to proceed.Thu, Mar 26, 7:00 PM
This comment was removed by chris.longros_gmail.com.
usr.sbin/newsyslog/newsyslog.c
1958–1960

Done !

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Mar 27, 7:30 PM
This revision was automatically updated to reflect the committed changes.