Page MenuHomeFreeBSD

newsyslog: check for rename failure during log rotation
ClosedPublic

Authored by chris.longros_gmail.com on Mar 25 2026, 7:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 18, 11:27 AM
Unknown Object (File)
Mon, May 18, 11:22 AM
Unknown Object (File)
Mon, May 18, 1:22 AM
Unknown Object (File)
Mon, May 18, 1:17 AM
Unknown Object (File)
Sun, May 10, 11:28 AM
Unknown Object (File)
Sun, May 10, 11:21 AM
Unknown Object (File)
Sun, May 10, 3:11 AM
Unknown Object (File)
Sun, May 10, 3:06 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.Mar 25 2026, 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.Mar 26 2026, 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.Mar 27 2026, 7:30 PM
This revision was automatically updated to reflect the committed changes.