Page MenuHomeFreeBSD

Properly patch up dirname()/basename() calls to not clobber ent->log.
ClosedPublic

Authored by ed on Sep 8 2016, 8:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jan 8, 2:11 AM
Unknown Object (File)
Nov 29 2024, 8:23 AM
Unknown Object (File)
Nov 25 2024, 5:15 AM
Unknown Object (File)
Nov 25 2024, 12:14 AM
Unknown Object (File)
Nov 24 2024, 11:13 PM
Unknown Object (File)
Nov 20 2024, 3:38 AM
Unknown Object (File)
Nov 19 2024, 1:46 PM
Unknown Object (File)
Nov 19 2024, 8:52 AM
Subscribers

Details

Summary

It turns out that we had a couple of more calls to dirname()/basename()
in newsyslog(8) that assume the input isn't clobbered. This is bad,
because it apparently breaks log rotation now that the new dirname()
implementation has been merged.

Fix this by first copying the input and then calling
dirname()/basename(). While there, improve the naming of variables in
this function a bit.

Diff Detail

Event Timeline

ed retitled this revision from to Properly patch up dirname()/basename() calls to not clobber ent->log..
ed updated this object.
ed edited the test plan for this revision. (Show Details)
ed added reviewers: gjb, ngie.
bdrewery added a reviewer: bdrewery.
bdrewery added a subscriber: bdrewery.
bdrewery added inline comments.
usr.sbin/newsyslog/newsyslog.c
1535

I don't see a reason for this old strdup

This revision is now accepted and ready to land.Sep 8 2016, 8:34 PM
This revision was automatically updated to reflect the committed changes.